Skip to content

Commit

Permalink
fix integrationBatch0
Browse files Browse the repository at this point in the history
  • Loading branch information
sgomezvillamor committed Mar 4, 2025
1 parent dfc5f4b commit f30322e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
6 changes: 3 additions & 3 deletions metadata-ingestion/src/datahub/ingestion/source/metabase.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def construct_dashboard_from_api_data(
return None

dashboard_urn = builder.make_dashboard_urn(
self.platform, dashboard_details.get("id", "")
self.platform, str(dashboard_details.get("id", ""))
)
dashboard_snapshot = DashboardSnapshot(
urn=dashboard_urn,
Expand All @@ -337,7 +337,7 @@ def construct_dashboard_from_api_data(
card_id = card_info.get("card").get("id", "")
if not card_id:
continue # most likely a virtual card without an id (text or heading), not relevant.
chart_urn = builder.make_chart_urn(self.platform, card_id)
chart_urn = builder.make_chart_urn(self.platform, str(card_id))
chart_urns.append(chart_urn)

dashboard_info_class = DashboardInfoClass(
Expand Down Expand Up @@ -459,7 +459,7 @@ def construct_card_from_api_data(self, card_data: dict) -> Optional[ChartSnapsho
)
return None

chart_urn = builder.make_chart_urn(self.platform, card_id)
chart_urn = builder.make_chart_urn(self.platform, str(card_id))
chart_snapshot = ChartSnapshot(
urn=chart_urn,
aspects=[],
Expand Down
2 changes: 1 addition & 1 deletion metadata-ingestion/src/datahub/ingestion/source/mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def _browse_path_chart(
]

def _dashboard_urn(self, report_info: dict) -> str:
return builder.make_dashboard_urn(self.platform, report_info.get("id", ""))
return builder.make_dashboard_urn(self.platform, str(report_info.get("id", "")))

def _parse_last_run_at(self, report_info: dict) -> Optional[int]:
# Mode queries are refreshed, and that timestamp is reflected correctly here.
Expand Down
14 changes: 14 additions & 0 deletions metadata-ingestion/tests/unit/sdk/test_mce_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ def test_create_urns_with_reserved_chars() -> None:
)
== "urn:li:dashboard:(platform%%28%29%2C%E2%90%9F,platform-instance%%28%29%2C%E2%90%9F.dashboard%%28%29%2C%E2%90%9F)"
)
assert (
builder.make_dashboard_urn(
platform=f"platform{_RESERVED_CHARS_STRING}",
name=f"dashboard{_RESERVED_CHARS_STRING}",
)
== "urn:li:dashboard:(platform%%28%29%2C%E2%90%9F,dashboard%%28%29%2C%E2%90%9F)"
)
assert (
builder.make_chart_urn(
platform=f"platform{_RESERVED_CHARS_STRING}",
Expand All @@ -99,6 +106,13 @@ def test_create_urns_with_reserved_chars() -> None:
)
== "urn:li:chart:(platform%%28%29%2C%E2%90%9F,platform-instance%%28%29%2C%E2%90%9F.dashboard%%28%29%2C%E2%90%9F)"
)
assert (
builder.make_chart_urn(
platform=f"platform{_RESERVED_CHARS_STRING}",
name=f"dashboard{_RESERVED_CHARS_STRING}",
)
== "urn:li:chart:(platform%%28%29%2C%E2%90%9F,dashboard%%28%29%2C%E2%90%9F)"
)


def test_make_user_urn() -> None:
Expand Down

0 comments on commit f30322e

Please sign in to comment.