From 841fd9cfe705ab20244eaf30345c3ca9f30a4d35 Mon Sep 17 00:00:00 2001 From: Onkar Ravgan Date: Wed, 20 Dec 2023 09:30:37 +0530 Subject: [PATCH] Fixed superset excp (#14447) --- .../metadata/ingestion/source/dashboard/superset/api_source.py | 2 +- .../metadata/ingestion/source/dashboard/superset/db_source.py | 2 +- .../src/metadata/ingestion/source/dashboard/superset/mixin.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ingestion/src/metadata/ingestion/source/dashboard/superset/api_source.py b/ingestion/src/metadata/ingestion/source/dashboard/superset/api_source.py index 9802383aea5..7d92d84ce91 100644 --- a/ingestion/src/metadata/ingestion/source/dashboard/superset/api_source.py +++ b/ingestion/src/metadata/ingestion/source/dashboard/superset/api_source.py @@ -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" ) diff --git a/ingestion/src/metadata/ingestion/source/dashboard/superset/db_source.py b/ingestion/src/metadata/ingestion/source/dashboard/superset/db_source.py index afe2f73ffb2..7dbd149f3da 100644 --- a/ingestion/src/metadata/ingestion/source/dashboard/superset/db_source.py +++ b/ingestion/src/metadata/ingestion/source/dashboard/superset/db_source.py @@ -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" ) diff --git a/ingestion/src/metadata/ingestion/source/dashboard/superset/mixin.py b/ingestion/src/metadata/ingestion/source/dashboard/superset/mixin.py index b37cf67c96c..a2fe190ed94 100644 --- a/ingestion/src/metadata/ingestion/source/dashboard/superset/mixin.py +++ b/ingestion/src/metadata/ingestion/source/dashboard/superset/mixin.py @@ -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: