Skip to content

feat(cypher): OR/XOR-around-pattern WHERE lowering (#1236)#1244

Merged
lmeyerov merged 2 commits intomasterfrom
issue-1236-or-xor-around-pattern
May 1, 2026
Merged

feat(cypher): OR/XOR-around-pattern WHERE lowering (#1236)#1244
lmeyerov merged 2 commits intomasterfrom
issue-1236-or-xor-around-pattern

Conversation

@lmeyerov
Copy link
Copy Markdown
Contributor

@lmeyerov lmeyerov commented Apr 30, 2026

Summary

Implements #1236 (parent #1031 slice 4): support boolean OR / XOR compositions around Cypher WHERE pattern predicates in local lowering/runtime.

What changed

  • Added row-pipeline primitive semi_apply_mark(...) for correlated pattern-existence marker columns.
  • Added AST helper + call-safelist entry/validation for semi_apply_mark.
  • Parser now preserves nested pattern leaves in boolean expr_tree for OR/XOR contexts instead of fail-fast rejection.
  • Lowering rewrites pattern leaves into generated marker columns via correlated semi-apply, then evaluates the rewritten boolean expression in row filtering.
  • Preserved existing positive/negated top-level pattern predicate handling.
  • Added direct unit tests for semi_apply_mark (safelist/schema-effects + runtime behavior), in addition to parser/lowering OR/XOR regressions.
  • Added missing changelog coverage under CHANGELOG.md ([Development] / Internal).

Files

  • graphistry/compute/ast.py
  • graphistry/compute/gfql/call/validation.py
  • graphistry/compute/gfql/row/pipeline.py
  • graphistry/compute/gfql/cypher/parser.py
  • graphistry/compute/gfql/cypher/_boolean_expr_text.py
  • graphistry/compute/gfql/cypher/lowering.py
  • graphistry/tests/compute/gfql/cypher/test_parser.py
  • graphistry/tests/compute/gfql/cypher/test_lowering.py
  • graphistry/tests/compute/gfql/test_row_pipeline_ops.py
  • CHANGELOG.md

Validation

Local

  • PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=. uv run --no-project --with lark pytest -q graphistry/tests/compute/gfql/test_row_pipeline_ops.py -k "semi_apply_mark"
    • 3 passed
  • PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=. uv run --no-project --with lark pytest -q graphistry/tests/compute/gfql/cypher/test_parser.py graphistry/tests/compute/gfql/cypher/test_lowering.py -k "executes_or_xor_around_pattern_predicates or where_pattern_predicate_and_expr_mix"
    • 17 passed
  • uv run ruff check graphistry/tests/compute/gfql/test_row_pipeline_ops.py
    • All checks passed

DGX RAPIDS matrix (ssh dgx-spark)

Targeted cuDF/GFQL subset:

  • test_graph_constructor_cudf_support
  • test_string_cypher_formats_filtered_edge_entity_projection_on_cudf
  • test_string_cypher_executes_real_cugraph_node_row_call_on_cudf
  • test_string_cypher_executes_or_xor_around_pattern_predicates

Results:

  • RAPIDS 25.02 + NUMBA_CUDA_USE_NVIDIA_BINDING=1: 6 passed
  • RAPIDS 26.02: 6 passed

Note:

CI

  • Current gh pr checks 1244: all checks passing, including both tck-gfql runs.
  • Remaining merge gate is required reviewer approval.

Closes #1236
Refs #1031

@lmeyerov lmeyerov force-pushed the issue-1236-or-xor-around-pattern branch from 42e5849 to 4c80fd5 Compare April 30, 2026 08:29
@lmeyerov lmeyerov merged commit 02d02af into master May 1, 2026
133 checks passed
@lmeyerov lmeyerov deleted the issue-1236-or-xor-around-pattern branch May 1, 2026 21:42
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: OR/XOR-around-pattern lowering via Apply/SemiApply runtime (#1031 slice 4)

1 participant