Skip to content

Commit 6281aad

Browse files
committed
fix(bigframes): updates comment related to select_items revision
1 parent b37e6f9 commit 6281aad

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/bigframes/bigframes/core/compile/sqlglot/sqlglot_ir.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,10 @@ def from_table(
214214
if not columns and not sql_predicate:
215215
return cls.from_expr(expr=table_expr, uid_gen=uid_gen)
216216

217+
# Qualify column references with the table alias to avoid ambiguity
218+
# when a table and a column share the same name. Without this, BigQuery
219+
# might interpret the column as a reference to the table (STRUCT),
220+
# causing failures when casting (e.g. in test_read_gbq_w_ambigous_name).
217221
select_items: list[sge.Expression] = (
218222
[sge.Column(this=sql.identifier(col), table=sql.identifier(table_alias)) for col in columns]
219223
if columns

0 commit comments

Comments
 (0)