Skip to content

Commit 5ac509a

Browse files
committed
Update remaining deprecated proc in examples and tests
1 parent a1567c0 commit 5ac509a

File tree

7 files changed

+15
-10
lines changed

7 files changed

+15
-10
lines changed

doc/modules/ROOT/pages/graph-object.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ In addition to those aforementioned there are five more methods that create grap
7272
* `gds.graph.project.cypher`
7373
* `gds.beta.graph.subgraph`
7474
* `gds.beta.graph.generate`
75-
* `gds.alpha.graph.sample.rwr`
75+
* `gds.graph.sample.rwr`
7676
* `gds.graph.sample.cnarw`
7777

7878
Their Cypher signatures map to Python in much the same way as `gds.graph.project` above.

doc/modules/ROOT/pages/tutorials/import-sample-export-gnn.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ It’s looks correct! Now let’s go ahead and sample the graph.
115115
[source, python, role=no-test]
116116
----
117117
# We use the random walk with restarts sampling algorithm with default values
118-
G_sample, _ = gds.alpha.graph.sample.rwr("cora_sample", G, randomSeed=42, concurrency=1)
118+
G_sample, _ = gds.graph.sample.rwr("cora_sample", G, randomSeed=42, concurrency=1)
119119
----
120120

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

doc/modules/ROOT/pages/tutorials/node-regression-with-subgraph-and-graph-sample.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ print("MEAN_ABSOLUTE_ERROR test score: " + str(train_result["modelInfo"]["me
451451
[source, python, role=no-test]
452452
----
453453
# Let's sample the graph to see if we can get a similarly good model
454-
G_chameleon_sample, _ = gds.alpha.graph.sample.rwr(
454+
G_chameleon_sample, _ = gds.graph.sample.rwr(
455455
"cham_sample",
456456
G_chameleon,
457457
samplingRatio=0.30, # We'll use 30% of the graph

examples/import-sample-export-gnn.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
"outputs": [],
177177
"source": [
178178
"# We use the random walk with restarts sampling algorithm with default values\n",
179-
"G_sample, _ = gds.alpha.graph.sample.rwr(\"cora_sample\", G, randomSeed=42, concurrency=1)"
179+
"G_sample, _ = gds.graph.sample.rwr(\"cora_sample\", G, randomSeed=42, concurrency=1)"
180180
]
181181
},
182182
{

examples/node-regression-with-subgraph-and-graph-sample.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@
568568
"outputs": [],
569569
"source": [
570570
"# Let's sample the graph to see if we can get a similarly good model\n",
571-
"G_chameleon_sample, _ = gds.alpha.graph.sample.rwr(\n",
571+
"G_chameleon_sample, _ = gds.graph.sample.rwr(\n",
572572
" \"cham_sample\",\n",
573573
" G_chameleon,\n",
574574
" samplingRatio=0.30, # We'll use 30% of the graph\n",

graphdatascience/tests/integration/test_graph_ops.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ def test_sample_rwr(runner: QueryRunner, gds: GraphDataScience) -> None:
105105
def test_sample_rwr_alpha(runner: QueryRunner, gds: GraphDataScience) -> None:
106106
from_G, _ = gds.graph.project(GRAPH_NAME, {"Node": {"properties": "x"}}, "*")
107107

108-
rwr_G, result = gds.alpha.graph.sample.rwr("s", from_G, samplingRatio=0.6, concurrency=1, randomSeed=42)
108+
with pytest.warns(DeprecationWarning):
109+
rwr_G, result = gds.alpha.graph.sample.rwr("s", from_G, samplingRatio=0.6, concurrency=1, randomSeed=42)
109110

110111
assert rwr_G.name() == "s"
111112
assert result["graphName"] == "s"
@@ -763,7 +764,8 @@ def test_graph_nodeLabel_mutate(gds: GraphDataScience) -> None:
763764
def test_graph_removeNodeProperties_21(gds: GraphDataScience) -> None:
764765
G, _ = gds.graph.project(GRAPH_NAME, {"Node": {"properties": "x"}}, "*")
765766

766-
result = gds.graph.removeNodeProperties(G, ["x"], concurrency=2)
767+
with pytest.warns(DeprecationWarning):
768+
result = gds.graph.removeNodeProperties(G, ["x"], concurrency=2)
767769
assert result["propertiesRemoved"] == 3
768770

769771

@@ -779,7 +781,8 @@ def test_graph_removeNodeProperties_22(gds: GraphDataScience) -> None:
779781
def test_graph_removeNodeProperties_20(gds: GraphDataScience) -> None:
780782
G, _ = gds.graph.project(GRAPH_NAME, {"Node": {"properties": "x"}}, "*")
781783

782-
result = gds.graph.removeNodeProperties(G, ["x"], ["*"], concurrency=2)
784+
with pytest.warns(DeprecationWarning):
785+
result = gds.graph.removeNodeProperties(G, ["x"], ["*"], concurrency=2)
783786
assert result["propertiesRemoved"] == 3
784787

785788

graphdatascience/tests/unit/test_graph_ops.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,8 @@ def test_graph_nodeLabel_mutate(runner: CollectingQueryRunner, gds: GraphDataSci
522522
def test_graph_removeNodeProperties_20(runner: CollectingQueryRunner, gds: GraphDataScience) -> None:
523523
G, _ = gds.graph.project("g", "*", "*")
524524

525-
gds.graph.removeNodeProperties(G, ["dummyProp"], "dummyLabel", concurrency=2)
525+
with pytest.warns(DeprecationWarning):
526+
gds.graph.removeNodeProperties(G, ["dummyProp"], "dummyLabel", concurrency=2)
526527
assert runner.last_query() == "CALL gds.graph.removeNodeProperties($graph_name, $properties, $entities, $config)"
527528
assert runner.last_params() == {
528529
"graph_name": "g",
@@ -536,7 +537,8 @@ def test_graph_removeNodeProperties_20(runner: CollectingQueryRunner, gds: Graph
536537
def test_graph_removeNodeProperties_21(runner: CollectingQueryRunner, gds: GraphDataScience) -> None:
537538
G, _ = gds.graph.project("g", "*", "*")
538539

539-
gds.graph.removeNodeProperties(G, ["dummyProp"], concurrency=2)
540+
with pytest.warns(DeprecationWarning):
541+
gds.graph.removeNodeProperties(G, ["dummyProp"], concurrency=2)
540542
assert runner.last_query() == "CALL gds.graph.removeNodeProperties($graph_name, $properties, $config)"
541543
assert runner.last_params() == {
542544
"graph_name": "g",

0 commit comments

Comments
 (0)