Skip to content

fix(executor): preserve SQL three-valued boolean logic [CODEX]#7961

Open
dev-willbird1936 wants to merge 1 commit into
tobymao:mainfrom
dev-willbird1936:fix/executor-three-valued-logic
Open

fix(executor): preserve SQL three-valued boolean logic [CODEX]#7961
dev-willbird1936 wants to merge 1 commit into
tobymao:mainfrom
dev-willbird1936:fix/executor-three-valued-logic

Conversation

@dev-willbird1936

Copy link
Copy Markdown
Contributor

Closes #7960.

The Python executor maps SQL boolean operators to Python truthiness, which makes NOT NULL evaluate as True instead of SQL UNKNOWN.

This patch adds SQL-aware NOT, AND, OR, and IN helpers. Lazy AND and OR operands preserve decisive short-circuit behavior, and boolean normalization keeps compatible scalar values working.

Regression tests cover nullable truth tables, nullable WHERE filtering, IN/NOT IN, NumPy boolean scalars, and evaluation count. The focused regressions, all 26 executor tests, Ruff, formatting, mypy, and git diff --check pass.

Disclosure: I used OpenAI Codex to assist with analysis and implementation. I reviewed and validated every submitted change.

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.

Python executor treats NOT NULL as true

1 participant