mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-09 23:40:05 +00:00
Fix Superset Owners & Descriptions (#10007)
This commit is contained in:
parent
c7c3d62bae
commit
8c7c21bd54
@ -143,7 +143,7 @@ class SupersetAPISource(SupersetSourceMixin):
|
||||
chart = CreateChartRequest(
|
||||
name=chart_json["id"],
|
||||
displayName=chart_json.get("slice_name"),
|
||||
description="",
|
||||
description=chart_json.get("description"),
|
||||
chartType=get_standard_chart_type(
|
||||
chart_json.get("viz_type", ChartType.Other.value)
|
||||
),
|
||||
|
||||
@ -147,7 +147,7 @@ class SupersetDBSource(SupersetSourceMixin):
|
||||
chart = CreateChartRequest(
|
||||
name=chart_json["id"],
|
||||
displayName=chart_json.get("slice_name"),
|
||||
description="",
|
||||
description=chart_json.get("description"),
|
||||
chartType=get_standard_chart_type(
|
||||
chart_json.get("viz_type", ChartType.Other.value)
|
||||
),
|
||||
|
||||
@ -69,11 +69,24 @@ class SupersetSourceMixin(DashboardServiceSource):
|
||||
"""
|
||||
return dashboard
|
||||
|
||||
def get_owner_details(self, dashboard_details: dict) -> EntityReference:
|
||||
if dashboard_details.get("email"):
|
||||
user = self.metadata.get_user_by_email(dashboard_details["email"])
|
||||
def _get_user_by_email(self, email: str) -> EntityReference:
|
||||
|
||||
if email:
|
||||
user = self.metadata.get_user_by_email(email)
|
||||
if user:
|
||||
return EntityReference(id=user.id.__root__, type="user")
|
||||
|
||||
return None
|
||||
|
||||
def get_owner_details(self, dashboard_details: dict) -> EntityReference:
|
||||
for owner in dashboard_details.get("owners", []):
|
||||
user = self._get_user_by_email(owner["email"])
|
||||
if user:
|
||||
return user
|
||||
if dashboard_details.get("email"):
|
||||
user = self._get_user_by_email(dashboard_details["email"])
|
||||
if user:
|
||||
return user
|
||||
return None
|
||||
|
||||
def _get_charts_of_dashboard(self, dashboard_details: dict) -> List[str]:
|
||||
|
||||
@ -16,6 +16,7 @@ FETCH_ALL_CHARTS = """
|
||||
select
|
||||
s.id,
|
||||
s.slice_name,
|
||||
s.description,
|
||||
t.table_name,
|
||||
t.schema,
|
||||
db.database_name,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user