Skip to content

Commit

Permalink
fix(pyarrow): compare list names when checking column names
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Jul 17, 2024
1 parent c131319 commit 7fa57a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ibis/formats/pyarrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ def convert_table(cls, table: pa.Table, schema: Schema) -> pa.Table:
desired_schema = PyArrowSchema.from_ibis(schema)
pa_schema = table.schema

if pa_schema.names != schema.names:
table = table.rename_columns(schema.names)
if list(pa_schema.names) != (schema_names := list(schema.names)):
table = table.rename_columns(schema_names)

Check warning on line 357 in ibis/formats/pyarrow.py

View check run for this annotation

Codecov / codecov/patch

ibis/formats/pyarrow.py#L357

Added line #L357 was not covered by tests

if pa_schema != desired_schema:
return table.cast(desired_schema, safe=False)
Expand Down

0 comments on commit 7fa57a9

Please sign in to comment.