Skip to content

Commit ffe2012

Browse files
committed
Remove deprecated streamNodePropertyies and add warning in tests
1 parent 49c503b commit ffe2012

File tree

7 files changed

+32
-18
lines changed

7 files changed

+32
-18
lines changed

doc/modules/ROOT/pages/tutorials/load-data-via-graph-construction.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ the graph, printing only the first 10.
186186

187187
[source, python, role=no-test]
188188
----
189-
gds.graph.streamNodeProperties(G, ["subject"]).head(10)
189+
gds.graph.nodeProperties.stream(G, ["subject"]).head(10)
190190
----
191191

192192
== Cleanup

doc/modules/ROOT/pages/tutorials/ml-pipelines-node-classification.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ model_fastrp.predict_mutate(
465465
targetNodeLabels=["UnclassifiedPaper"],
466466
)
467467
468-
predicted_fastrp = gds.graph.streamNodeProperty(G, "predictedClass", ["UnclassifiedPaper"])
468+
predicted_fastrp = gds.graph.nodeProperty.stream(G, "predictedClass", ["UnclassifiedPaper"])
469469
----
470470

471471
[source, python, role=no-test]

examples/load-data-via-graph-construction.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@
351351
"metadata": {},
352352
"outputs": [],
353353
"source": [
354-
"gds.graph.streamNodeProperties(G, [\"subject\"]).head(10)"
354+
"gds.graph.nodeProperties.stream(G, [\"subject\"]).head(10)"
355355
]
356356
},
357357
{

examples/ml-pipelines-node-classification.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@
634634
" targetNodeLabels=[\"UnclassifiedPaper\"],\n",
635635
")\n",
636636
"\n",
637-
"predicted_fastrp = gds.graph.streamNodeProperty(G, \"predictedClass\", [\"UnclassifiedPaper\"])"
637+
"predicted_fastrp = gds.graph.nodeProperty.stream(G, \"predictedClass\", [\"UnclassifiedPaper\"])"
638638
]
639639
},
640640
{

graphdatascience/tests/integration/test_graph_construct.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,9 @@ def test_imdb_graph_with_arrow(gds: GraphDataScience) -> None:
151151
def test_roundtrip_with_arrow(gds: GraphDataScience) -> None:
152152
G, _ = gds.graph.project(GRAPH_NAME, {"Node": {"properties": ["x", "y"]}}, {"REL": {"properties": "relX"}})
153153

154-
rel_df = gds.graph.streamRelationshipProperty(G, "relX")
155-
node_df = gds.graph.streamNodeProperty(G, "x")
154+
with pytest.warns(DeprecationWarning):
155+
rel_df = gds.graph.streamRelationshipProperty(G, "relX")
156+
node_df = gds.graph.streamNodeProperty(G, "x")
156157

157158
G_2 = gds.graph.construct("arrowGraph", node_df, rel_df)
158159

@@ -185,8 +186,9 @@ def test_roundtrip_with_arrow_22(gds: GraphDataScience) -> None:
185186
def test_roundtrip_with_arrow_encrypted(gds_with_tls: GraphDataScience) -> None:
186187
G, _ = gds_with_tls.graph.project(GRAPH_NAME, {"Node": {"properties": ["x", "y"]}}, {"REL": {"properties": "relX"}})
187188

188-
rel_df = gds_with_tls.graph.streamRelationshipProperty(G, "relX")
189-
node_df = gds_with_tls.graph.streamNodeProperty(G, "x")
189+
with pytest.warns(DeprecationWarning):
190+
rel_df = gds_with_tls.graph.streamRelationshipProperty(G, "relX")
191+
node_df = gds_with_tls.graph.streamNodeProperty(G, "x")
190192

191193
G_2 = gds_with_tls.graph.construct("arrowGraph", node_df, rel_df)
192194

graphdatascience/tests/integration/test_graph_ops.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,8 @@ def test_graph_get(gds: GraphDataScience) -> None:
260260
def test_graph_streamNodeProperty_with_arrow(gds: GraphDataScience) -> None:
261261
G, _ = gds.graph.project(GRAPH_NAME, {"Node": {"properties": "x"}}, "*")
262262

263-
result = gds.graph.streamNodeProperty(G, "x", concurrency=2)
263+
with pytest.warns(DeprecationWarning):
264+
result = gds.graph.streamNodeProperty(G, "x", concurrency=2)
264265
assert {e for e in result["propertyValue"]} == {1, 2, 3}
265266

266267

@@ -301,7 +302,8 @@ def test_graph_nodeProperty_stream_with_arrow_no_db() -> None:
301302
def test_graph_streamNodeProperty_without_arrow(gds_without_arrow: GraphDataScience) -> None:
302303
G, _ = gds_without_arrow.graph.project(GRAPH_NAME, {"Node": {"properties": "x"}}, "*")
303304

304-
result = gds_without_arrow.graph.streamNodeProperty(G, "x", concurrency=2)
305+
with pytest.warns(DeprecationWarning):
306+
result = gds_without_arrow.graph.streamNodeProperty(G, "x", concurrency=2)
305307

306308
assert {e for e in result["propertyValue"]} == {1, 2, 3}
307309

@@ -318,7 +320,8 @@ def test_graph_nodeProperty_stream_without_arrow(gds_without_arrow: GraphDataSci
318320
def test_graph_streamNodeProperties_with_arrow(gds: GraphDataScience) -> None:
319321
G, _ = gds.graph.project(GRAPH_NAME, {"Node": {"properties": ["x", "y"]}}, "*")
320322

321-
result = gds.graph.streamNodeProperties(G, ["x", "y"], concurrency=2)
323+
with pytest.warns(DeprecationWarning):
324+
result = gds.graph.streamNodeProperties(G, ["x", "y"], concurrency=2)
322325

323326
assert list(result.keys()) == ["nodeId", "nodeProperty", "propertyValue"]
324327

@@ -355,7 +358,8 @@ def test_graph_nodeProperties_stream_with_arrow(gds: GraphDataScience) -> None:
355358
def test_graph_streamNodeProperties_with_arrow_separate_property_columns(gds: GraphDataScience) -> None:
356359
G, _ = gds.graph.project(GRAPH_NAME, {"Node": {"properties": ["x", "y"]}}, "*")
357360

358-
result = gds.graph.streamNodeProperties(G, ["x", "y"], separate_property_columns=True, concurrency=2)
361+
with pytest.warns(DeprecationWarning):
362+
result = gds.graph.streamNodeProperties(G, ["x", "y"], separate_property_columns=True, concurrency=2)
359363
assert list(result.keys()) == ["nodeId", "x", "y"]
360364
assert {e for e in result["x"]} == {1, 2, 3}
361365
assert {e for e in result["y"]} == {2, 3, 4}
@@ -390,7 +394,8 @@ def test_graph_nodeProperties_stream_raise_error_with_duplicate_keys(gds: GraphD
390394
def test_graph_streamNodeProperties_without_arrow(gds_without_arrow: GraphDataScience) -> None:
391395
G, _ = gds_without_arrow.graph.project(GRAPH_NAME, {"Node": {"properties": ["x", "y"]}}, "*")
392396

393-
result = gds_without_arrow.graph.streamNodeProperties(G, ["x", "y"], concurrency=2)
397+
with pytest.warns(DeprecationWarning):
398+
result = gds_without_arrow.graph.streamNodeProperties(G, ["x", "y"], concurrency=2)
394399

395400
assert list(result.keys()) == ["nodeId", "nodeProperty", "propertyValue"]
396401

@@ -431,7 +436,10 @@ def test_graph_streamNodeProperties_without_arrow_separate_property_columns(
431436
) -> None:
432437
G, _ = gds_without_arrow.graph.project(GRAPH_NAME, {"Node": {"properties": ["x", "z"]}}, "*")
433438

434-
result = gds_without_arrow.graph.streamNodeProperties(G, ["x", "z"], separate_property_columns=True, concurrency=2)
439+
with pytest.warns(DeprecationWarning):
440+
result = gds_without_arrow.graph.streamNodeProperties(
441+
G, ["x", "z"], separate_property_columns=True, concurrency=2
442+
)
435443

436444
assert list(result.keys()) == ["nodeId", "x", "z"]
437445

graphdatascience/tests/unit/test_graph_ops.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ def test_graph_export_csv(runner: CollectingQueryRunner, gds: GraphDataScience)
125125
def test_graph_streamNodeProperty(runner: CollectingQueryRunner, gds: GraphDataScience) -> None:
126126
G, _ = gds.graph.project("g", "*", "*")
127127

128-
gds.graph.streamNodeProperty(G, "dummyProp", concurrency=2)
128+
with pytest.warns(DeprecationWarning):
129+
gds.graph.streamNodeProperty(G, "dummyProp", concurrency=2)
129130
assert runner.last_query() == "CALL gds.graph.streamNodeProperty($graph_name, $properties, $entities, $config)"
130131
assert runner.last_params() == {
131132
"graph_name": "g",
@@ -134,7 +135,8 @@ def test_graph_streamNodeProperty(runner: CollectingQueryRunner, gds: GraphDataS
134135
"config": {"concurrency": 2},
135136
}
136137

137-
gds.graph.streamNodeProperty(G, "dummyProp", "dummyLabel", concurrency=2)
138+
with pytest.warns(DeprecationWarning):
139+
gds.graph.streamNodeProperty(G, "dummyProp", "dummyLabel", concurrency=2)
138140
assert runner.last_query() == "CALL gds.graph.streamNodeProperty($graph_name, $properties, $entities, $config)"
139141
assert runner.last_params() == {
140142
"graph_name": "g",
@@ -172,7 +174,8 @@ def test_graph_streamNodeProperties(runner: CollectingQueryRunner, gds: GraphDat
172174

173175
runner.set__mock_result(DataFrame([{"nodeId": 0, "dummyProp": 2}]))
174176

175-
gds.graph.streamNodeProperties(G, ["dummyProp"], concurrency=2)
177+
with pytest.warns(DeprecationWarning):
178+
gds.graph.streamNodeProperties(G, ["dummyProp"], concurrency=2)
176179
assert runner.last_query() == "CALL gds.graph.streamNodeProperties($graph_name, $properties, $entities, $config)"
177180
assert runner.last_params() == {
178181
"graph_name": "g",
@@ -181,7 +184,8 @@ def test_graph_streamNodeProperties(runner: CollectingQueryRunner, gds: GraphDat
181184
"config": {"concurrency": 2},
182185
}
183186

184-
gds.graph.streamNodeProperties(G, ["dummyProp"], "dummyLabel", concurrency=2)
187+
with pytest.warns(DeprecationWarning):
188+
gds.graph.streamNodeProperties(G, ["dummyProp"], "dummyLabel", concurrency=2)
185189
assert runner.last_query() == "CALL gds.graph.streamNodeProperties($graph_name, $properties, $entities, $config)"
186190
assert runner.last_params() == {
187191
"graph_name": "g",

0 commit comments

Comments
 (0)