Skip to content

Commit 1bb6e2a

Browse files
committed
Remove warnings in tests for older versions
1 parent 5ac509a commit 1bb6e2a

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

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.graph.sample.rwr(\"cora_sample\", G, randomSeed=42, concurrency=1)"
179+
"G_sample, _ = gds.alpha.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.graph.sample.rwr(\n",
571+
"G_chameleon_sample, _ = gds.alpha.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: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ 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-
with pytest.warns(DeprecationWarning):
108+
if gds.server_version() >= ServerVersion(2, 4, 0):
109+
with pytest.warns(DeprecationWarning):
110+
rwr_G, result = gds.alpha.graph.sample.rwr("s", from_G, samplingRatio=0.6, concurrency=1, randomSeed=42)
111+
else:
109112
rwr_G, result = gds.alpha.graph.sample.rwr("s", from_G, samplingRatio=0.6, concurrency=1, randomSeed=42)
110113

111114
assert rwr_G.name() == "s"

graphdatascience/tests/unit/test_graph_ops.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -522,8 +522,7 @@ 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-
with pytest.warns(DeprecationWarning):
526-
gds.graph.removeNodeProperties(G, ["dummyProp"], "dummyLabel", concurrency=2)
525+
gds.graph.removeNodeProperties(G, ["dummyProp"], "dummyLabel", concurrency=2)
527526
assert runner.last_query() == "CALL gds.graph.removeNodeProperties($graph_name, $properties, $entities, $config)"
528527
assert runner.last_params() == {
529528
"graph_name": "g",
@@ -537,8 +536,7 @@ def test_graph_removeNodeProperties_20(runner: CollectingQueryRunner, gds: Graph
537536
def test_graph_removeNodeProperties_21(runner: CollectingQueryRunner, gds: GraphDataScience) -> None:
538537
G, _ = gds.graph.project("g", "*", "*")
539538

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

0 commit comments

Comments
 (0)