Skip to content

Commit

Permalink
fix(ingest/metabase): Use connect_uri instead of display_uri to query…
Browse files Browse the repository at this point in the history
… Metabase API (#9996)
  • Loading branch information
diegmonti authored Mar 21, 2024
1 parent c480b59 commit 7a2d61d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions metadata-ingestion/src/datahub/ingestion/source/metabase.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def construct_dashboard_from_api_data(
self, dashboard_info: dict
) -> Optional[DashboardSnapshot]:
dashboard_id = dashboard_info.get("id", "")
dashboard_url = f"{self.config.display_uri}/api/dashboard/{dashboard_id}"
dashboard_url = f"{self.config.connect_uri}/api/dashboard/{dashboard_id}"
try:
dashboard_response = self.session.get(dashboard_url)
dashboard_response.raise_for_status()
Expand Down Expand Up @@ -296,7 +296,7 @@ def construct_dashboard_from_api_data(
title=title,
charts=chart_urns,
lastModified=last_modified,
dashboardUrl=f"{self.config.connect_uri}/dashboard/{dashboard_id}",
dashboardUrl=f"{self.config.display_uri}/dashboard/{dashboard_id}",
customProperties={},
)
dashboard_snapshot.aspects.append(dashboard_info_class)
Expand All @@ -310,7 +310,7 @@ def construct_dashboard_from_api_data(

@lru_cache(maxsize=None)
def _get_ownership(self, creator_id: int) -> Optional[OwnershipClass]:
user_info_url = f"{self.config.display_uri}/api/user/{creator_id}"
user_info_url = f"{self.config.connect_uri}/api/user/{creator_id}"
try:
user_info_response = self.session.get(user_info_url)
user_info_response.raise_for_status()
Expand Down Expand Up @@ -375,7 +375,7 @@ def get_card_details_by_id(self, card_id: Union[int, str]) -> dict:
:param int datasource_id: Numeric datasource ID received from Metabase API
:return: dict with info or empty dict
"""
card_url = f"{self.config.display_uri}/api/card/{card_id}"
card_url = f"{self.config.connect_uri}/api/card/{card_id}"
try:
card_response = self.session.get(card_url)
card_response.raise_for_status()
Expand Down Expand Up @@ -431,7 +431,7 @@ def construct_card_from_api_data(self, card_data: dict) -> Optional[ChartSnapsho
description=description,
title=title,
lastModified=last_modified,
chartUrl=f"{self.config.connect_uri}/card/{card_id}",
chartUrl=f"{self.config.display_uri}/card/{card_id}",
inputs=datasource_urn,
customProperties=custom_properties,
)
Expand Down

0 comments on commit 7a2d61d

Please sign in to comment.