Skip to content

Commit 4cf85dd

Browse files
committed
test(gfql): add chain/list dispatch same-path parity
1 parent ed8b1f4 commit 4cf85dd

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/gfql/ref/test_cudf_executor_inputs.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
execute_same_path_chain,
1010
)
1111
from graphistry.compute.gfql_unified import gfql
12+
from graphistry.compute.chain import Chain
1213
from graphistry.gfql.same_path_types import col, compare
1314
from graphistry.gfql.ref.enumerator import OracleCaps, enumerate_chain
1415
from graphistry.tests.test_compute import CGFull
@@ -414,3 +415,27 @@ def test_dispatch_dict_where_triggers_executor():
414415
assert set(result._nodes["id"]) == set(oracle.nodes["id"])
415416
assert set(result._edges["src"]) == set(oracle.edges["src"])
416417
assert set(result._edges["dst"]) == set(oracle.edges["dst"])
418+
419+
420+
def test_dispatch_chain_list_and_single_ast():
421+
graph = _make_graph()
422+
chain_ops = [
423+
n({"type": "account"}, name="a"),
424+
e_forward(name="r"),
425+
n({"type": "user"}, name="c"),
426+
]
427+
where = [compare(col("a", "owner_id"), "==", col("c", "id"))]
428+
429+
for query in [Chain(chain_ops, where=where), chain_ops]:
430+
result = gfql(graph, query, engine=Engine.PANDAS)
431+
oracle = enumerate_chain(
432+
graph,
433+
chain_ops if isinstance(query, list) else list(chain_ops),
434+
where=where,
435+
include_paths=False,
436+
caps=OracleCaps(max_nodes=20, max_edges=20),
437+
)
438+
assert result._nodes is not None and result._edges is not None
439+
assert set(result._nodes["id"]) == set(oracle.nodes["id"])
440+
assert set(result._edges["src"]) == set(oracle.edges["src"])
441+
assert set(result._edges["dst"]) == set(oracle.edges["dst"])

0 commit comments

Comments
 (0)