Skip to content

fix: refine nullability after SQL filters - #711

Merged
chio-labs-delivery[bot] merged 1 commit into
mainfrom
fix/refine-filtered-nullability
Sep 17, 2026
Merged

chio-labs-delivery[bot] merged 1 commit into
mainfrom
fix/refine-filtered-nullability

Conversation

@kvlonge

@kvlonge kvlonge commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Why

A direct projected column filtered by IS NOT NULL remained nullable in inferred output facts. This produced a false contract diagnostic even though the SQL filter proves the output is non-null.

Changes

  • infer direct projected columns as non-null when a conjunctive IS NOT NULL filter proves that fact
  • preserve scope across aliases, self-joins, outer joins, and CTE boundaries
  • apply the same refinement to compact and AST analysis paths

Verification

  • uv run pytest tests/unit/src/sqlbuild/compiler/compile/_helpers/test_sql_analysis_columns.py -n auto --dist loadfile
  • uv run fensu check
  • uv sync --all-extras
  • make check-ci
  • public-repository hygiene scan
  • cache-free static compile of the downstream 974-model project: 0 errors, 0 warnings

@chio-labs-delivery
chio-labs-delivery Bot enabled auto-merge (squash) September 17, 2026 23:09
@chio-labs-delivery
chio-labs-delivery Bot merged commit 55c5a90 into main Sep 17, 2026
18 of 19 checks passed
@chio-labs-delivery
chio-labs-delivery Bot deleted the fix/refine-filtered-nullability branch September 17, 2026 23:22
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.

1 participant