Skip to content

Commit 658617f

Browse files
committed
Add deprecation warnings in tests for other deprecated procs
1 parent 35deba4 commit 658617f

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

graphdatascience/tests/integration/test_graph_ops.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,8 @@ def test_graph_writeNodeProperties(gds: GraphDataScience) -> None:
704704

705705
gds.pageRank.mutate(G, mutateProperty="rank", dampingFactor=0.2, tolerance=0.3)
706706

707-
result = gds.graph.writeNodeProperties(G, ["rank"], concurrency=2)
707+
with pytest.warns(DeprecationWarning):
708+
result = gds.graph.writeNodeProperties(G, ["rank"], concurrency=2)
708709
assert result["propertiesWritten"] == 3
709710

710711

@@ -713,7 +714,8 @@ def test_graph_writeRelationship(gds: GraphDataScience) -> None:
713714

714715
gds.nodeSimilarity.mutate(G, mutateRelationshipType="SIMILAR", mutateProperty="score", similarityCutoff=0)
715716

716-
result = gds.graph.writeRelationship(G, "SIMILAR", "score", concurrency=2)
717+
with pytest.warns(DeprecationWarning):
718+
result = gds.graph.writeRelationship(G, "SIMILAR", "score", concurrency=2)
717719
assert result["relationshipsWritten"] == 2
718720
assert result["propertiesWritten"] == 2
719721

@@ -784,7 +786,8 @@ def test_graph_removeNodeProperties_20(gds: GraphDataScience) -> None:
784786
def test_graph_deleteRelationships(gds: GraphDataScience) -> None:
785787
G, _ = gds.graph.project(GRAPH_NAME, "*", ["REL", "REL2"])
786788

787-
result = gds.graph.deleteRelationships(G, "REL")
789+
with pytest.warns(DeprecationWarning):
790+
result = gds.graph.deleteRelationships(G, "REL")
788791
assert result["deletedRelationships"] == 3
789792

790793

graphdatascience/tests/unit/test_graph_ops.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,8 @@ def test_graph_relationshipProperties_write(runner: CollectingQueryRunner, gds:
389389
def test_graph_writeNodeProperties(runner: CollectingQueryRunner, gds: GraphDataScience) -> None:
390390
G, _ = gds.graph.project("g", "*", "*")
391391

392-
gds.graph.writeNodeProperties(G, ["dummyProp"], concurrency=2)
392+
with pytest.warns(DeprecationWarning):
393+
gds.graph.writeNodeProperties(G, ["dummyProp"], concurrency=2)
393394
assert runner.last_query() == "CALL gds.graph.writeNodeProperties($graph_name, $properties, $entities, $config)"
394395
assert runner.last_params() == {
395396
"graph_name": "g",
@@ -398,7 +399,8 @@ def test_graph_writeNodeProperties(runner: CollectingQueryRunner, gds: GraphData
398399
"config": {"concurrency": 2},
399400
}
400401

401-
gds.graph.writeNodeProperties(G, ["dummyProp"], "dummyLabel", concurrency=2)
402+
with pytest.warns(DeprecationWarning):
403+
gds.graph.writeNodeProperties(G, ["dummyProp"], "dummyLabel", concurrency=2)
402404
assert runner.last_query() == "CALL gds.graph.writeNodeProperties($graph_name, $properties, $entities, $config)"
403405
assert runner.last_params() == {
404406
"graph_name": "g",
@@ -434,7 +436,8 @@ def test_graph_nodeProperties_write(runner: CollectingQueryRunner, gds: GraphDat
434436
def test_graph_writeRelationship(runner: CollectingQueryRunner, gds: GraphDataScience) -> None:
435437
G, _ = gds.graph.project("g", "*", "*")
436438

437-
gds.graph.writeRelationship(G, "dummyType", "dummyProp", concurrency=2)
439+
with pytest.warns(DeprecationWarning):
440+
gds.graph.writeRelationship(G, "dummyType", "dummyProp", concurrency=2)
438441
assert (
439442
runner.last_query()
440443
== "CALL gds.graph.writeRelationship($graph_name, $relationship_type, $relationship_property, $config)"
@@ -446,7 +449,8 @@ def test_graph_writeRelationship(runner: CollectingQueryRunner, gds: GraphDataSc
446449
"config": {"concurrency": 2},
447450
}
448451

449-
gds.graph.writeRelationship(G, "dummyType", concurrency=2)
452+
with pytest.warns(DeprecationWarning):
453+
gds.graph.writeRelationship(G, "dummyType", concurrency=2)
450454
assert (
451455
runner.last_query()
452456
== "CALL gds.graph.writeRelationship($graph_name, $relationship_type, $relationship_property, $config)"
@@ -557,7 +561,8 @@ def test_graph_nodeProperties_remove_drop(runner: CollectingQueryRunner, gds: Gr
557561
def test_graph_deleteRelationships(runner: CollectingQueryRunner, gds: GraphDataScience) -> None:
558562
G, _ = gds.graph.project("g", "*", "*")
559563

560-
gds.graph.deleteRelationships(G, "REL_A")
564+
with pytest.warns(DeprecationWarning):
565+
gds.graph.deleteRelationships(G, "REL_A")
561566
assert runner.last_query() == "CALL gds.graph.deleteRelationships($graph_name, $relationship_type)"
562567
assert runner.last_params() == {"graph_name": "g", "relationship_type": "REL_A"}
563568

@@ -612,7 +617,9 @@ def test_graph_generate(runner: CollectingQueryRunner, gds: GraphDataScience) ->
612617

613618
def test_alpha_graph_sample_rwr(runner: CollectingQueryRunner, gds: GraphDataScience) -> None:
614619
from_G, _ = gds.graph.project("g", "*", "*")
615-
gds.alpha.graph.sample.rwr("s", from_G, samplingRatio=0.9, concurrency=7)
620+
621+
with pytest.warns(DeprecationWarning):
622+
gds.alpha.graph.sample.rwr("s", from_G, samplingRatio=0.9, concurrency=7)
616623

617624
assert runner.last_query() == "CALL gds.alpha.graph.sample.rwr($graph_name, $from_graph_name, $config)"
618625
assert runner.last_params() == {

0 commit comments

Comments
 (0)