@@ -558,3 +558,36 @@ def test_graph_alpha_construct_backward_compat_with_arrow(gds: GraphDataScience)
558558
559559 with pytest .warns (DeprecationWarning ):
560560 gds .alpha .graph .construct ("hello" , nodes , relationships )
561+
562+ @pytest .mark .enterprise
563+ @pytest .mark .compatible_with (min_inclusive = ServerVersion (2 , 1 , 0 ))
564+ def test_graph_alpha_construct_backward_compat_with_arrow (gds : GraphDataScience ) -> None :
565+ nodes = DataFrame ({"nodeId" : [0 , 1 , 2 , 3 ]})
566+ relationships = DataFrame ({"sourceNodeId" : [0 , 1 , 2 , 3 ], "targetNodeId" : [1 , 2 , 3 , 0 ]})
567+
568+ with pytest .warns (DeprecationWarning ):
569+ gds .alpha .graph .construct ("hello" , nodes , relationships )
570+
571+
572+ @pytest .mark .compatible_with (min_inclusive = ServerVersion (2 , 2 , 0 ))
573+ def test_roundtrip_with_arrow (gds : GraphDataScience ) -> None :
574+ G , _ = gds .graph .project (GRAPH_NAME , {"Node" : {"properties" : ["x" , "y" ]}}, {"REL" : {"properties" : "relX" }})
575+
576+ rel_df = gds .graph .relationshipProperty .stream (G , "relX" )
577+ node_df = gds .graph .nodeProperty .stream (G , "x" )
578+
579+ G_2 = gds .graph .construct ("arrowGraph" , node_df , rel_df )
580+
581+ res = gds .graph .list ()
582+ try :
583+ assert set (res ['graphName' ].tolist ()) == {'g' , 'arrowGraph' }
584+ assert G .node_count () == G_2 .node_count ()
585+ assert G .relationship_count () == G_2 .relationship_count ()
586+ finally :
587+ G_2 .drop ()
588+
589+ @pytest .mark .compatible_with (min_inclusive = ServerVersion (2 , 2 , 0 ))
590+ def test_drop_list_warning_reproduction (gds : GraphDataScience ) -> None :
591+ G , _ = gds .graph .project (GRAPH_NAME , {"Node" : {"properties" : ["x" , "y" ]}}, {"REL" : {"properties" : "relX" }})
592+ res = gds .graph .list ()
593+ assert res ['graphName' ].tolist () == ['g' ]
0 commit comments