Skip to content

fix: fix the boolean coercion bug for any() and all() in SQLGlot - #18090

Draft
sycai wants to merge 2 commits into
mainfrom
sycai_fix_sqlglot_bool_coercion
Draft

fix: fix the boolean coercion bug for any() and all() in SQLGlot#18090
sycai wants to merge 2 commits into
mainfrom
sycai_fix_sqlglot_bool_coercion

Conversation

@sycai

@sycai sycai commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Probably won't merge the PR as we will start using GoB as the source of truth soon. Uploading the code changes purely for references.

@sycai sycai added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Aug 12, 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 refactors the boolean coercion logic by introducing a reusable helper function _to_nullable_bool in common.py. This helper is now utilized in both unary_compiler.py (for LOGICAL_AND and LOGICAL_OR aggregations) and generic_ops.py (for coerce_to_bool_op), replacing duplicate type-checking logic. Additionally, unit tests and SQL snapshots have been updated to cover string and array-like types. There are no review comments, so we have no feedback to provide.

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