From b9540b0c7de4948ee4329afaf67fefbe8ede176e Mon Sep 17 00:00:00 2001 From: Ayush Shah Date: Wed, 12 Mar 2025 23:42:10 +0530 Subject: [PATCH] Minor: Fix Superset Dashboard Lineage Handling (#20207) * Fix Superset Dashboard Lineage Handling - Safely handle chart SQL attribute using getattr - Update error message for dashboard lineage details to be more generic * refactor: formatting improvement in Superset dashboard lineage handling --- .../src/metadata/ingestion/source/dashboard/superset/mixin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ingestion/src/metadata/ingestion/source/dashboard/superset/mixin.py b/ingestion/src/metadata/ingestion/source/dashboard/superset/mixin.py index 7e796697011..8b661cd1813 100644 --- a/ingestion/src/metadata/ingestion/source/dashboard/superset/mixin.py +++ b/ingestion/src/metadata/ingestion/source/dashboard/superset/mixin.py @@ -282,7 +282,7 @@ class SupersetSourceMixin(DashboardServiceSource): return result def _get_input_tables(self, chart: FetchChart): - if chart.sql: + if getattr(chart, "sql", None): result = self._parse_lineage_from_dataset_sql(chart) else: result = [ @@ -339,7 +339,7 @@ class SupersetSourceMixin(DashboardServiceSource): except Exception as exc: yield Either( left=StackTraceError( - name=db_service_name, + name="Dashboard Lineage Details", error=( "Error to yield dashboard lineage details for DB " f"service name [{db_service_name}]: {exc}"