Skip to content

No proper error is raised on wrong index in Table.add_column #454

@surister

Description

@surister

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions