Skip to content

Commit e2fda15

Browse files
authored
Merge pull request #581 from FlorentinD/support-staging
Handle devenv set to staging for GdsSessions
2 parents 9976343 + cc0e8df commit e2fda15

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

graphdatascience/gds_session/aura_api.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,14 @@ def is_expired(self) -> bool:
8787

8888
def __init__(self, client_id: str, client_secret: str, tenant_id: Optional[str] = None) -> None:
8989
self._dev_env = os.environ.get("AURA_ENV")
90-
self._base_uri = "https://api.neo4j.io" if not self._dev_env else f"https://api-{self._dev_env}.neo4j-dev.io"
90+
91+
if not self._dev_env:
92+
self._base_uri = "https://api.neo4j.io"
93+
elif self._dev_env == "staging":
94+
self._base_uri = "https://api-staging.neo4j.io"
95+
else:
96+
self._base_uri = f"https://api-{self._dev_env}.neo4j-dev.io"
97+
9198
self._credentials = (client_id, client_secret)
9299
self._token: Optional[AuraApi.AuraAuthToken] = None
93100
self._logger = logging.getLogger()

0 commit comments

Comments
 (0)