Skip to content

fix(bigframes): parenthesize OR expressions for AND chaining in SQLGlot - #18113

Draft
sycai wants to merge 2 commits into
mainfrom
sycai_fix_and_chaining
Draft

fix(bigframes): parenthesize OR expressions for AND chaining in SQLGlot#18113
sycai wants to merge 2 commits into
mainfrom
sycai_fix_and_chaining

Conversation

@sycai

@sycai sycai commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@sycai sycai self-assigned this Aug 13, 2026
@sycai sycai added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Aug 13, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request ensures that OR expressions are correctly parenthesized when combined with AND operators in the SQLGlot compiler, and adds unit tests to verify the generated SQL. The reviewer pointed out that using copy=False when parenthesizing expressions can lead to AST corruption in SQLGlot due to parent pointer mutation, and recommended copying the expression instead.

Comment thread packages/bigframes/bigframes/core/compile/sqlglot/sqlglot_ir.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge Indicates a pull request not ready for merge, due to either quality or timing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant