Skip to content

Commit 479b834

Browse files
committed
Mark some more endpoints as retryable
they are idempotent (list/stream)
1 parent c21351e commit 479b834

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

graphdatascience/graph/graph_entity_ops_runner.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ def drop(
343343
def stream(self, G: Graph, relationship_types: list[str] = ["*"], **config: Any) -> TopologyDataFrame:
344344
self._namespace += ".stream"
345345
params = CallParameters(graph_name=G.name(), relationship_types=relationship_types, config=config)
346-
result = self._query_runner.call_procedure(endpoint=self._namespace, params=params)
346+
result = self._query_runner.call_procedure(endpoint=self._namespace, params=params, retryable=True)
347347

348348
return TopologyDataFrame(result)
349349

@@ -361,7 +361,9 @@ def stream(self, G: Graph, relationship_types: list[str] = ["*"], **config: Any)
361361
self._namespace += ".stream"
362362
params = CallParameters(graph_name=G.name(), relationship_types=relationship_types, config=config)
363363

364-
return TopologyDataFrame(self._query_runner.call_procedure(endpoint=self._namespace, params=params))
364+
return TopologyDataFrame(
365+
self._query_runner.call_procedure(endpoint=self._namespace, params=params, retryable=True)
366+
)
365367

366368
@property
367369
@compatible_with("toUndirected", min_inclusive=ServerVersion(2, 3, 0))
@@ -382,7 +384,7 @@ def stream(
382384
self._namespace += ".stream"
383385
params = CallParameters(graph_name=G.name(), graph_property=graph_property, config=config)
384386

385-
return self._query_runner.call_procedure(endpoint=self._namespace, params=params)
387+
return self._query_runner.call_procedure(endpoint=self._namespace, params=params, retryable=True)
386388

387389
@compatible_with("drop", min_inclusive=ServerVersion(2, 2, 0))
388390
@graph_type_check

graphdatascience/utils/direct_util_endpoints.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ def find_node_id(self, labels: list[str] = [], properties: dict[str, Any] = {})
4848
else:
4949
query = "MATCH (n) RETURN id(n) AS id"
5050

51-
# TODO use execute query
52-
node_match = self._query_runner.run_cypher(query, custom_error=False)
51+
node_match = self._query_runner.run_retryable_cypher(query, custom_error=False)
5352

5453
if len(node_match) != 1:
5554
raise ValueError(f"Filter did not match with exactly one node: {node_match}")
@@ -84,7 +83,7 @@ def list(self) -> DataFrame:
8483
A DataFrame containing all available GDS procedures.
8584
"""
8685
namespace = self._namespace + ".list"
87-
return self._query_runner.call_procedure(endpoint=namespace, custom_error=False)
86+
return self._query_runner.call_procedure(endpoint=namespace, custom_error=False, retryable=True)
8887

8988

9089
class IndirectUtilAlphaEndpoints(CallerBase):

0 commit comments

Comments
 (0)