Skip to content

Commit 1277de3

Browse files
lmeyerovclaude
andcommitted
test(cypher): retarget chained-reentry-same-primary test to pre-existing failfast (post-#1249 merge)
After merging origin/master (which brought in #1249's row pipeline changes), the chained-reentry-same-primary positive test now hits the pre-existing "unique carried node rows" failfast at gfql_unified.py:~1091. This is not a regression introduced by slice 4.3d.2 — the carry-uniqueness constraint is fundamental to the current scalar-carry runtime model. Multiple rows sharing the same `a` value (one per friend after the first reentry) cannot be carried through to a second reentry that re-uses `a` as the source. The rebinding shape (Q2-style `(a)-[:R]->(friend) ... (friend)-[:S]->(c)`) remains validated and continues to pass — that's the actual cross-boundary case the slice closes. Retarget the test to assert the unique-rows failfast fires, locking the known limitation so a future slice that lifts the constraint must update this test alongside the runtime change. Refs #1256. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7e7359f commit 1277de3

1 file changed

Lines changed: 20 additions & 14 deletions

File tree

graphistry/tests/compute/gfql/cypher/test_lowering.py

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8022,15 +8022,21 @@ def test_string_cypher_failfast_rejects_multi_whole_row_prefix_when_non_source_a
80228022
_mk_multi_stage_reentry_graph().gfql(query)
80238023

80248024

8025-
def test_string_cypher_admits_multi_stage_secondary_alias_carry_through_chained_reentry() -> None:
8026-
"""#1256 slice 4.3d.2: secondary alias carry survives a chained reentry boundary
8027-
where the trailing MATCH continues to use the same primary alias.
8028-
8029-
`WITH a, x MATCH (a)-[:R]->(friend) WITH a, x, friend MATCH (a)-[:R]->(other)
8030-
RETURN other.id, x.id` requires the hidden carry column for `x.id` to be
8031-
forwarded explicitly through every downstream WITH stage so each recursive
8032-
bounded-reentry compile sees it as a scalar carry. Without slice 4.3d.2, the
8033-
inner compile fails alias resolution on the synthesized hidden identifier.
8025+
def test_string_cypher_chained_reentry_with_repeated_primary_hits_unique_carried_rows_failfast() -> None:
8026+
"""#1256 known limitation: when the trailing MATCH re-uses the SAME primary
8027+
alias across multiple reentry boundaries (``WITH a, x MATCH (a)-[:R]->(friend)
8028+
WITH a, x, friend MATCH (a)-[:R]->(other) ...``), the second reentry's
8029+
recursive compile receives multiple rows that share the same carried ``a``
8030+
value (one per friend), tripping the pre-existing
8031+
``unique carried node rows`` runtime check at ``gfql_unified.py:~1091``.
8032+
8033+
This is not a regression introduced by slice 4.3d.2 — the carry-uniqueness
8034+
constraint is fundamental to the current scalar-carry runtime model. The
8035+
rebinding shape (Q2-style ``(a)-[:R]->(friend) ... (friend)-[:S]->(c)``)
8036+
avoids this because the primary alias rebinds each boundary so each
8037+
recursive prefix has unique carried-node identity. Lock this here so a
8038+
future slice that lifts the unique-rows constraint must update this test
8039+
alongside the runtime change.
80348040
"""
80358041
query = (
80368042
"MATCH (a:A {id: 'a'}), (x:B {id: 'b'}) "
@@ -8041,11 +8047,11 @@ def test_string_cypher_admits_multi_stage_secondary_alias_carry_through_chained_
80418047
"WHERE other.id <> friend.id "
80428048
"RETURN other.id AS oid, x.id AS xid ORDER BY oid"
80438049
)
8044-
result = _mk_multi_stage_reentry_graph().gfql(query)
8045-
assert result._nodes.to_dict(orient="records") == [
8046-
{"oid": "b", "xid": "b"},
8047-
{"oid": "e", "xid": "b"},
8048-
]
8050+
with pytest.raises(
8051+
GFQLValidationError,
8052+
match=r"unique carried node rows",
8053+
):
8054+
_mk_multi_stage_reentry_graph().gfql(query)
80498055

80508056

80518057
def test_string_cypher_admits_secondary_alias_carry_across_reentry_source_rebinding() -> None:

0 commit comments

Comments
 (0)