Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(snowflake): Wrap DIV0 operands if they're binary expressions #4393

Merged
merged 3 commits into from
Nov 14, 2024

Conversation

VaggelisD
Copy link
Collaborator

Fixes #4392

Conditionally wrap the DIV0 operands as going from a function based -> binop representation can alter the precedence.

Docs

SF DIV0

sqlglot/dialects/snowflake.py Outdated Show resolved Hide resolved
sqlglot/expressions.py Outdated Show resolved Hide resolved
@georgesittas georgesittas merged commit 79f6783 into main Nov 14, 2024
3 checks passed
@georgesittas georgesittas deleted the vaggelisd/sf_div0 branch November 14, 2024 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

div0() parsing bug in parse_one(sql, read=sqlglot.Dialects.SNOWFLAKE)
2 participants