Fix #1219: quote-aware pattern-existence pre-scan + whitebox tests#1291
Merged
Fix #1219: quote-aware pattern-existence pre-scan + whitebox tests#1291
Conversation
This was referenced May 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a concrete #1219 front-end policy-boundary bug found during whitebox amplification.
The parser's pre-parse unsupported-form check for pattern-existence syntax (
exists { ... },not((pattern))) previously scanned raw query text, so it falsely rejected valid row-only queries when those lexemes appeared inside string literals.This PR makes the pre-scan quote/backtick-aware and adds regression coverage.
Changes
graphistry/compute/gfql/cypher/parser.py_check_unsupported_syntax_patterns()now scans masked text.graphistry/tests/compute/gfql/cypher/test_parser.pygraphistry/tests/compute/gfql/cypher/test_where_row_boolean_policy_boundary.pyCHANGELOG.mdValidation
python -m pytest -q graphistry/tests/compute/gfql/cypher/test_parser.py -k "pattern_existence_lexemes_inside_string_literals or still_rejects_true_pattern_existence"7 passed, 115 deselectedpython -m pytest -q graphistry/tests/compute/gfql/cypher/test_where_row_boolean_policy_boundary.py10 passedpython -m pytest -q graphistry/tests/compute/gfql/cypher/test_lowering.py -k "pattern_existence"4 passed, 881 deselectedUV_CACHE_DIR=/tmp/uv-cache uv run ruff check graphistry/compute/gfql/cypher/parser.py graphistry/tests/compute/gfql/cypher/test_parser.py graphistry/tests/compute/gfql/cypher/test_where_row_boolean_policy_boundary.pyAll checks passedRefs #1219