@@ -549,6 +549,32 @@ def test_graph_relationshipProperties_stream_without_arrow_separate_property_col
549549 assert {e for e in result ["relY" ]} == {5 , 6 , 7 }
550550
551551
552+ @pytest .mark .compatible_with (min_inclusive = ServerVersion (2 , 2 , 0 ))
553+ def test_graph_relationships_stream_without_arrow (gds_without_arrow : GraphDataScience ) -> None :
554+ G , _ = gds_without_arrow .graph .project (GRAPH_NAME , "*" , "REL" )
555+
556+ result = gds_without_arrow .beta .graph .relationships .stream (G , ["REL" ])
557+
558+ expected = gds_without_arrow .run_cypher ("MATCH (n)-[REL]->(m) RETURN id(n) AS src_id, id(m) AS trg_id" )
559+
560+ assert list (result .keys ()) == ["sourceNodeId" , "targetNodeId" , "relationshipType" ]
561+ assert {e for e in result ["sourceNodeId" ]} == {i for i in expected ["src_id" ]}
562+ assert {e for e in result ["targetNodeId" ]} == {i for i in expected ["trg_id" ]}
563+
564+
565+ @pytest .mark .compatible_with (min_inclusive = ServerVersion (2 , 2 , 0 ))
566+ def test_graph_relationships_stream_with_arrow (gds : GraphDataScience ) -> None :
567+ G , _ = gds .graph .project (GRAPH_NAME , "*" , "REL" )
568+
569+ result = gds .beta .graph .relationships .stream (G , ["REL" ])
570+
571+ expected = gds .run_cypher ("MATCH (n)-[REL]->(m) RETURN id(n) AS src_id, id(m) AS trg_id" )
572+
573+ assert list (result .keys ()) == ["sourceNodeId" , "targetNodeId" , "relationshipType" ]
574+ assert {e for e in result ["sourceNodeId" ]} == {i for i in expected ["src_id" ]}
575+ assert {e for e in result ["targetNodeId" ]} == {i for i in expected ["trg_id" ]}
576+
577+
552578def test_graph_writeNodeProperties (gds : GraphDataScience ) -> None :
553579 G , _ = gds .graph .project (GRAPH_NAME , "*" , "*" )
554580
0 commit comments