Skip to content

Commit 3f86dd0

Browse files
committed
fix: sqlglot losses all CTE statements
1 parent b0f16e6 commit 3f86dd0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bigframes/core/compile/sqlglot/sqlglot_ir.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,14 +625,14 @@ def _select_to_cte(expr: sge.Select, cte_name: sge.Identifier) -> sge.Select:
625625
into a new CTE and then generates a 'SELECT * FROM new_cte_name'
626626
for the new query."""
627627
select_expr = expr.copy()
628-
existing_ctes = select_expr.args.pop("with", [])
628+
existing_ctes = select_expr.args.pop("with_", [])
629629
new_cte = sge.CTE(
630630
this=select_expr,
631631
alias=cte_name,
632632
)
633633
new_with_clause = sge.With(expressions=[*existing_ctes, new_cte])
634634
new_select_expr = sge.Select().select(sge.Star()).from_(sge.Table(this=cte_name))
635-
new_select_expr.set("with", new_with_clause)
635+
new_select_expr.set("with_", new_with_clause)
636636
return new_select_expr
637637

638638

0 commit comments

Comments
 (0)