Skip to content

Commit

Permalink
fix(datafusion): always quote column names to prevent datafusion from…
Browse files Browse the repository at this point in the history
… normalizing case
  • Loading branch information
cpcloud authored and jcrist committed Jul 5, 2023
1 parent a8f4880 commit 310db2b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
8 changes: 2 additions & 6 deletions ibis/backends/datafusion/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,8 @@ def cast(op):

@translate.register(ops.TableColumn)
def column(op):
table_op = op.table

if hasattr(table_op, "name"):
return df.column(f'{table_op.name}."{op.name}"')
else:
return df.column(op.name)
id_parts = [getattr(op.table, "name", None), op.name]
return df.column(".".join(f'"{id}"' for id in id_parts if id))


@translate.register(ops.SortKey)
Expand Down
1 change: 0 additions & 1 deletion ibis/backends/tests/test_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ def test_column_to_pyarrow_array(limit, awards_players):


@pytest.mark.parametrize("limit", no_limit)
@pytest.mark.xfail_version(datafusion=["datafusion>=21"])
def test_empty_column_to_pyarrow(limit, awards_players):
expr = awards_players.filter(awards_players.awardID == "DEADBEEF").awardID
array = expr.to_pyarrow(limit=limit)
Expand Down

0 comments on commit 310db2b

Please sign in to comment.