diff --git a/ibis/backends/datafusion/compiler.py b/ibis/backends/datafusion/compiler.py index f0fca32ad38c..e54863e74b9f 100644 --- a/ibis/backends/datafusion/compiler.py +++ b/ibis/backends/datafusion/compiler.py @@ -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) diff --git a/ibis/backends/tests/test_export.py b/ibis/backends/tests/test_export.py index 198d6f827c19..25cd6bb3a5c9 100644 --- a/ibis/backends/tests/test_export.py +++ b/ibis/backends/tests/test_export.py @@ -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)