fix(graph/client): use fixed GMS URL consistently (#13945)

This commit is contained in:
Michael Maltese 2025-07-03 11:57:11 -06:00 committed by GitHub
parent ef3446f066
commit 9d79914295
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -505,7 +505,7 @@ class DataHubGraph(DatahubRestEmitter, EntityVersioningAPI):
"limit": limit, "limit": limit,
"filter": filter, "filter": filter,
} }
end_point = f"{self.config.server}/aspects?action=getTimeseriesAspectValues" end_point = f"{self._gms_server}/aspects?action=getTimeseriesAspectValues"
resp: Dict = self._post_generic(end_point, query_body) resp: Dict = self._post_generic(end_point, query_body)
values: Optional[List] = resp.get("value", {}).get("values") values: Optional[List] = resp.get("value", {}).get("values")
@ -525,7 +525,7 @@ class DataHubGraph(DatahubRestEmitter, EntityVersioningAPI):
def get_entity_raw( def get_entity_raw(
self, entity_urn: str, aspects: Optional[List[str]] = None self, entity_urn: str, aspects: Optional[List[str]] = None
) -> Dict: ) -> Dict:
endpoint: str = f"{self.config.server}/entitiesV2/{Urn.url_encode(entity_urn)}" endpoint: str = f"{self._gms_server}/entitiesV2/{Urn.url_encode(entity_urn)}"
if aspects is not None: if aspects is not None:
assert aspects, "if provided, aspects must be a non-empty list" assert aspects, "if provided, aspects must be a non-empty list"
endpoint = f"{endpoint}?aspects=List(" + ",".join(aspects) + ")" endpoint = f"{endpoint}?aspects=List(" + ",".join(aspects) + ")"
@ -655,15 +655,15 @@ class DataHubGraph(DatahubRestEmitter, EntityVersioningAPI):
@property @property
def _search_endpoint(self): def _search_endpoint(self):
return f"{self.config.server}/entities?action=search" return f"{self._gms_server}/entities?action=search"
@property @property
def _relationships_endpoint(self): def _relationships_endpoint(self):
return f"{self.config.server}/openapi/relationships/v1/" return f"{self._gms_server}/openapi/relationships/v1/"
@property @property
def _aspect_count_endpoint(self): def _aspect_count_endpoint(self):
return f"{self.config.server}/aspects?action=getCount" return f"{self._gms_server}/aspects?action=getCount"
def get_domain_urn_by_name(self, domain_name: str) -> Optional[str]: def get_domain_urn_by_name(self, domain_name: str) -> Optional[str]:
"""Retrieve a domain urn based on its name. Returns None if there is no match found""" """Retrieve a domain urn based on its name. Returns None if there is no match found"""
@ -1210,7 +1210,7 @@ class DataHubGraph(DatahubRestEmitter, EntityVersioningAPI):
operation_name: Optional[str] = None, operation_name: Optional[str] = None,
format_exception: bool = True, format_exception: bool = True,
) -> Dict: ) -> Dict:
url = f"{self.config.server}/api/graphql" url = f"{self._gms_server}/api/graphql"
body: Dict = { body: Dict = {
"query": query, "query": query,
@ -1817,7 +1817,7 @@ class DataHubGraph(DatahubRestEmitter, EntityVersioningAPI):
"Accept": "application/json", "Accept": "application/json",
"Content-Type": "application/json", "Content-Type": "application/json",
} }
url = f"{self.config.server}/openapi/v2/entity/batch/{entity_name}" url = f"{self._gms_server}/openapi/v2/entity/batch/{entity_name}"
response = self._session.post(url, data=json.dumps(payload), headers=headers) response = self._session.post(url, data=json.dumps(payload), headers=headers)
response.raise_for_status() response.raise_for_status()
@ -1874,7 +1874,7 @@ class DataHubGraph(DatahubRestEmitter, EntityVersioningAPI):
"Content-Type": "application/json", "Content-Type": "application/json",
} }
url = f"{self.config.server}/openapi/v3/entity/{entity_name}/batchGet" url = f"{self._gms_server}/openapi/v3/entity/{entity_name}/batchGet"
if with_system_metadata: if with_system_metadata:
url += "?systemMetadata=true" url += "?systemMetadata=true"