Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ingest/metabase): Use connect_uri instead of display_uri to query Metabase API #9996

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading