@@ -196,14 +196,12 @@ def run_cypher(
196196 df = result .to_df ()
197197
198198 if self ._NEO4J_DRIVER_VERSION < SemanticVersion (5 , 0 , 0 ):
199- self ._last_bookmarks = [session .last_bookmark ()]
199+ self ._last_bookmarks = [session .last_bookmark ()] # type: ignore
200200 else :
201201 self ._last_bookmarks = session .last_bookmarks ()
202202
203- notifications = result .consume ().notifications
204- if notifications :
205- for notification in notifications :
206- self ._forward_cypher_warnings (notification )
203+ result_summary = result .consume ()
204+ self ._handle_notifications (result_summary )
207205
208206 return df
209207
@@ -321,7 +319,21 @@ def encrypted(self) -> bool:
321319 def driver_config (self ) -> dict [str , Any ]:
322320 return self ._config
323321
324- def _forward_cypher_warnings (self , notification : dict [str , Any ]) -> None :
322+ def _handle_notifications (self , result_summary : neo4j .ResultSummary ) -> None :
323+ if self ._NEO4J_DRIVER_VERSION < SemanticVersion (6 , 0 , 0 ):
324+ notifications = result_summary .notifications
325+ if notifications :
326+ for notification in notifications :
327+ self ._forward_cypher_notification (notification )
328+ if self ._NEO4J_DRIVER_VERSION >= SemanticVersion (6 , 0 , 0 ):
329+ status_objects = result_summary .gql_status_objects
330+ for status in status_objects :
331+ if status .raw_classification == "DEPRECATION" and not re .match (
332+ r".*returned by the procedure.*" , status .status_description
333+ ):
334+ warnings .warn (DeprecationWarning (status .status_description ))
335+
336+ def _forward_cypher_notification (self , notification : dict [str , Any ]) -> None :
325337 # (see https://neo4j.com/docs/status-codes/current/notifications/ for more details)
326338 severity = notification ["severity" ]
327339 if severity == "WARNING" :
@@ -434,7 +446,7 @@ def _verify_connectivity(
434446 category = neo4j .ExperimentalWarning ,
435447 message = r"^The configuration may change in the future.$" ,
436448 )
437- else :
449+ elif self . _NEO4J_DRIVER_VERSION < SemanticVersion ( 6 , 0 , 0 ) :
438450 warnings .filterwarnings (
439451 "ignore" ,
440452 category = neo4j .ExperimentalWarning ,
@@ -443,6 +455,13 @@ def _verify_connectivity(
443455 "They might be changed or removed in any future version without prior notice.$"
444456 ),
445457 )
458+ else :
459+ warnings .filterwarnings (
460+ "ignore" ,
461+ category = neo4j .warnings .PreviewWarning ,
462+ message = (r"^Passing key-word arguments to verify_connectivity\(\) is a preview feature.*" ),
463+ )
464+
446465 self ._driver .verify_connectivity (database = database )
447466 break
448467 except neo4j .exceptions .DriverError as e :
@@ -478,6 +497,8 @@ def __configure_warnings_filter(self) -> None:
478497 warnings .filterwarnings ("ignore" , message = r".*The procedure has a deprecated field.*by 'gds.*" )
479498 # neo4j driver 4.4
480499 warnings .filterwarnings ("ignore" , message = r".*The query used a deprecated field from a procedure.*by 'gds.*" )
500+ # neo4j driver 6.0
501+ warnings .filterwarnings ("ignore" , message = r".*returned by the procedure.* is deprecated.*" )
481502
482503 class ConnectivityRetriesConfig (NamedTuple ):
483504 max_retries : int = 600
0 commit comments