If you add an index that is not valid, for example len(table.columns) + 1 we get this error.
table = table.add_column(len(table.columns) + 1,'ab', pa.array(range(num_rows)))
pyo3_runtime.PanicException: insertion index (is 1001) should be <= len (is 1000)
Now, the question is, is it enough with raising a pyo3_runtime.PanicException or should we raise something more specific like IndexError.
Pyarrow raises:
pyarrow.lib.ArrowInvalid: Invalid column index to add field.