Fixed superset excp (#14447)

This commit is contained in:
Onkar Ravgan 2023-12-20 09:30:37 +05:30 committed by GitHub
parent ffe4aa319f
commit 841fd9cfe7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -193,7 +193,7 @@ class SupersetAPISource(SupersetSourceMixin):
for chart_id in self._get_charts_of_dashboard(dashboard_details):
try:
chart_json = self.all_charts.get(chart_id)
if not chart_json:
if not chart_json or not chart_json.datasource_id:
logger.warning(
f"chart details for id: {chart_id} not found, skipped"
)

View File

@ -215,7 +215,7 @@ class SupersetDBSource(SupersetSourceMixin):
if self.source_config.includeDataModels:
for chart_id in self._get_charts_of_dashboard(dashboard_details):
chart_json = self.all_charts.get(chart_id)
if not chart_json:
if not chart_json or not chart_json.datasource_id:
logger.warning(
f"chart details for id: {chart_id} not found, skipped"
)

View File

@ -230,7 +230,7 @@ class SupersetSourceMixin(DashboardServiceSource):
name=field.id,
displayName=field.column_name,
description=field.description,
dataLength=col_parse.get("dataLength", 0),
dataLength=int(col_parse.get("dataLength", 0)),
)
datasource_columns.append(parsed_fields)
except Exception as exc: