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
This commit is contained in:
Ayush Shah 2025-03-12 23:42:10 +05:30 committed by GitHub
parent a47d725975
commit b9540b0c7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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}"