Skip to content

Commit 604e37d

Browse files
committed
test(gfql/polars): give start_nodes real node rows, not a bare key column
I committed this test file without running pytest on it — the container parity probes covered the same ground, so the gap went unnoticed until the rebase. Three cases failed: start_nodes stands in for the node frame, so a key-only frame made the seed's own `id` predicate raise before reaching the semi-join under test. Mutation-checked now: dropping the `.unique()` that must STAY (the alias frame feeding a how='left' join) fails 7 of these tests, which is the row-multiplication regression they exist to catch. Restoring the removed `.unique()` on the start_nodes key side is correctly inert — it is a no-op by construction.
1 parent 5d01b91 commit 604e37d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

graphistry/tests/compute/gfql/test_engine_polars_semi_key_dedup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,11 @@ def test_duplicate_start_nodes_do_not_change_the_result(shape):
125125
schema, not just a malformed graph."""
126126
_, g_pl = _pair(*_clean_frames())
127127
chain = list(SHAPES[shape])
128-
uniq = pl.DataFrame({"key": [0, 1, 2]})
129-
dup = pl.DataFrame({"key": [0, 1, 1, 2, 2, 2]})
128+
# Full node rows, not a bare key column: start_nodes stands in for the node frame, so
129+
# a key-only frame would make the seed's own `id` predicate fail before reaching the
130+
# semi-join this test is about.
131+
uniq = g_pl._nodes.filter(pl.col("key").is_in([0, 1, 2]))
132+
dup = pl.concat([uniq, uniq.head(2), uniq.head(2)], how="vertical")
130133
try:
131134
a = g_pl.chain(chain, engine="polars", start_nodes=uniq)
132135
b = g_pl.chain(chain, engine="polars", start_nodes=dup)

0 commit comments

Comments
 (0)