MINOR: Fix pydantic v2 issues with domo (#17507)

* Fix pydantic v2 issues with domo

* Fix sourceURL for domo charts
This commit is contained in:
IceS2 2024-08-21 11:10:12 +02:00 committed by GitHub
parent c055620ff4
commit ac6b192fb3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View File

@ -126,7 +126,7 @@ class DomoClient:
if isinstance(response, list) and len(response) > 0:
return DomoChartDetails(
id=response[0]["id"],
id=str(response[0]["id"]),
name=response[0]["title"],
metadata=DomoChartMetadataDetails(
chartType=response[0].get("metadata", {}).get("chartType", "")

View File

@ -185,7 +185,7 @@ class DomodashboardSource(DashboardServiceSource):
pages = self.client.domo.page_get(page_id)
return DomoDashboardDetails(
name=pages["name"],
id=pages["id"],
id=str(pages["id"]),
cardIds=pages.get("cardIds", []),
description=pages.get("description", ""),
collectionIds=pages.get("collectionIds", []),
@ -217,7 +217,7 @@ class DomodashboardSource(DashboardServiceSource):
try:
chart = self.client.custom.get_chart_details(page_id=chart_id)
chart_url = (
f"{self.service_connection.instanceDomain}/page/"
f"{self.service_connection.instanceDomain}page/"
f"{dashboard_details.id}/kpis/details/{chart_id}"
)
@ -227,7 +227,7 @@ class DomodashboardSource(DashboardServiceSource):
if chart.name:
yield Either(
right=CreateChartRequest(
name=EntityName(chart_id),
name=EntityName(str(chart_id)),
description=Markdown(chart.description)
if chart.description
else None,

View File

@ -89,7 +89,7 @@ class DomopipelineSource(PipelineServiceSource):
self, pipeline_details
) -> Iterable[Either[CreatePipelineRequest]]:
try:
pipeline_name = pipeline_details["id"]
pipeline_name = str(pipeline_details["id"])
source_url = self.get_source_url(pipeline_id=pipeline_name)
task = Task(
name=pipeline_name,