Skip to content

Commit 27d48fe

Browse files
committed
test(gfql): add dispatch same-path dict case
1 parent d2cdbfb commit 27d48fe

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
@@ -8,6 +8,7 @@
88
CuDFSamePathExecutor,
99
execute_same_path_chain,
1010
)
11+
from graphistry.compute.gfql_unified import gfql
1112
from graphistry.gfql.same_path_types import col, compare
1213
from graphistry.gfql.ref.enumerator import OracleCaps, enumerate_chain
1314
from graphistry.tests.test_compute import CGFull
@@ -389,3 +390,27 @@ def test_cudf_gpu_path_if_available():
389390
assert result._nodes is not None and result._edges is not None
390391
assert set(result._nodes["id"].to_pandas()) == {"acct1", "acct2"}
391392
assert set(result._edges["src"].to_pandas()) == {"acct1", "acct2"}
393+
394+
395+
def test_dispatch_dict_where_triggers_executor():
396+
pytest.importorskip("cudf")
397+
graph = _make_graph()
398+
query = {
399+
"chain": [
400+
{"type": "Node", "name": "a", "filter_dict": {"type": "account"}},
401+
{"type": "Edge", "name": "r", "direction": "forward", "hops": 1},
402+
{"type": "Node", "name": "c", "filter_dict": {"type": "user"}},
403+
],
404+
"where": [{"eq": {"left": "a.owner_id", "right": "c.id"}}],
405+
}
406+
result = gfql(graph, query, engine=Engine.CUDF)
407+
oracle = enumerate_chain(
408+
graph, [n({"type": "account"}, name="a"), e_forward(name="r"), n({"type": "user"}, name="c")],
409+
where=[compare(col("a", "owner_id"), "==", col("c", "id"))],
410+
include_paths=False,
411+
caps=OracleCaps(max_nodes=20, max_edges=20),
412+
)
413+
assert result._nodes is not None and result._edges is not None
414+
assert set(result._nodes["id"]) == set(oracle.nodes["id"])
415+
assert set(result._edges["src"]) == set(oracle.edges["src"])
416+
assert set(result._edges["dst"]) == set(oracle.edges["dst"])

0 commit comments

Comments
 (0)