diff --git a/src/graph_notebook/neptune/client.py b/src/graph_notebook/neptune/client.py index e784001f..3f7bf59b 100644 --- a/src/graph_notebook/neptune/client.py +++ b/src/graph_notebook/neptune/client.py @@ -5,6 +5,7 @@ import json import logging +import re import requests from SPARQLWrapper import SPARQLWrapper @@ -190,7 +191,8 @@ def gremlin_query(self, query, bindings=None): return results except Exception as e: if isinstance(e, GremlinServerError): - if e.status_code == 499: + source_err = re.compile('The traversal source \\[.] for alias \\[.] is not configured on the server\\.') + if e.status_code == 499 and source_err.search(str(e)): print("Error returned by the Gremlin Server for the traversal_source specified in notebook " "configuration. Please ensure that your graph database endpoint supports re-naming of " "GraphTraversalSource from the default of 'g' in Gremlin Server.") @@ -207,7 +209,6 @@ def gremlin_http_query(self, query, headers=None) -> requests.Response: res = self._http_session.send(req) return res - def gremlin_status(self, query_id: str = '', include_waiting: bool = False): kwargs = {} if include_waiting: