@@ -206,7 +206,7 @@ def run_retryable_cypher(
206206 params : Optional [dict [str , Any ]] = None ,
207207 database : Optional [str ] = None ,
208208 custom_error : bool = True ,
209- routing : Optional [neo4j . RoutingControl ] = None ,
209+ mode : Optional [QueryMode ] = None ,
210210 connectivity_retry_config : Optional [ConnectivityRetriesConfig ] = None ,
211211 ) -> DataFrame :
212212 if not database :
@@ -215,8 +215,10 @@ def run_retryable_cypher(
215215 if self ._NEO4J_DRIVER_VERSION < SemanticVersion (5 , 5 , 0 ):
216216 return self .run_cypher (query , params , database , custom_error , connectivity_retry_config )
217217
218- if not routing :
218+ if not mode :
219219 routing = neo4j .RoutingControl .READ
220+ else :
221+ routing = mode .neo4j_routing ()
220222
221223 try :
222224 return self ._driver .execute_query (
@@ -240,9 +242,7 @@ def call_function(self, endpoint: str, params: Optional[CallParameters] = None,
240242 query = f"RETURN { endpoint } ({ params .placeholder_str ()} )"
241243
242244 # we can use retryable cypher as we expect all gds functions to be idempotent
243- return self .run_retryable_cypher (
244- query , params , custom_error = custom_error , routing = neo4j .RoutingControl .READ
245- ).squeeze ()
245+ return self .run_retryable_cypher (query , params , custom_error = custom_error , mode = QueryMode .READ ).squeeze ()
246246
247247 def call_procedure (
248248 self ,
@@ -263,7 +263,7 @@ def call_procedure(
263263
264264 def run_cypher_query () -> DataFrame :
265265 if retryable :
266- return self .run_retryable_cypher (query , params , database , custom_error , routing = mode . neo4j_mode () )
266+ return self .run_retryable_cypher (query , params , database , custom_error , mode = mode )
267267 else :
268268 return self .run_cypher (query , params , database , custom_error )
269269
0 commit comments