Skip to content

fix(gfql): honor quantifier scope in WITH WHERE - #2352

Draft
lmeyerov wants to merge 2 commits into
masterfrom
fix/gfql-with-where-quantifier-scope-2338
Draft

lmeyerov wants to merge 2 commits into
masterfrom
fix/gfql-with-where-quantifier-scope-2338

Conversation

@lmeyerov

@lmeyerov lmeyerov commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Generalization

WITH ... WHERE now preserves lexical scope when rewriting alias properties. Loop variables in any, all, none, single, and list comprehensions shadow a MATCH alias with the same name. Outer aliases remain visible, and nested scopes shadow correctly.

Cross-engine incl polars-gpu

  • Tests parametrize pandas, cuDF, Polars, and polars-gpu.
  • Pandas and cuDF execute both quantifier and list-comprehension forms and preserve all rows.
  • Polars and polars-gpu retain their structured unsupported-row-expression decline; no pandas bridge is added.
  • An unshadowed outer output control proves the rewrite remains active outside local scopes.

Cross-platform and version

  • Exact head: f938471e642ab05444b7993afba9ea5c05a6b0e3.
  • Desktop focused new scope tests: 6 passed, 6 GPU-only skipped, 0 failed.
  • Related lowering scope: 35 runnable tests passed; cuDF failures were desktop-only cudaErrorNoDevice setup failures.
  • Ruff, diff-check, type hygiene, and shell/repo guards pass.
  • Mypy remains at the master baseline: 18 diagnostics, zero delta.
  • Exact-head hosted CI run 44196273368 and CodeQL run 44196273140 are green.
  • RAPIDS 25.02/26.02 and polars-gpu validation remain pending.

Tests

  • New tests are red-first on pandas and Polars.
  • Quantifier, list comprehension, outer-output, and nested scope positions are covered.
  • Structured Polars declines are asserted instead of accepting silent fallback.

Hygiene

  • Mypy has zero delta versus master.
  • Type-hygiene guard reports no growth.
  • Ruff and diff checks pass.
  • CHANGELOG documents the user-visible behavior.

Size

  • One read-side topic: WITH ... WHERE alias-property rewriting respects lexical scope.

Fixes #2338.

🤖 Generated with Codex

This branch has not been deployed

No deployments
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.

GFQL Cypher: WITH ... WHERE rewrite ignores quantifier scope (any(n IN ... WHERE n.prop ...) drops rows)

1 participant