From 709fa7415f7cda66023c2d86bc951b4f1ce042a3 Mon Sep 17 00:00:00 2001 From: Ayush Shah Date: Mon, 15 Jan 2024 18:19:27 +0530 Subject: [PATCH] Fixes 13343: Fix Superset table name issue (#14714) --- .../ingestion/source/dashboard/superset/db_source.py | 5 +++-- .../metadata/ingestion/source/dashboard/superset/queries.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) 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 1b03c5744ba..a8efb2db6ee 100644 --- a/ingestion/src/metadata/ingestion/source/dashboard/superset/db_source.py +++ b/ingestion/src/metadata/ingestion/source/dashboard/superset/db_source.py @@ -86,8 +86,9 @@ class SupersetDBSource(SupersetSourceMixin): def get_column_list(self, table_name: str) -> Iterable[FetchChart]: try: if table_name: - sql_query = sql.text(FETCH_COLUMN.format(table_name=table_name.lower())) - col_list = self.engine.execute(sql_query) + col_list = self.engine.execute( + sql.text(FETCH_COLUMN), table_name=table_name.lower() + ) return [FetchColumn(**col) for col in col_list] except Exception as err: logger.debug(traceback.format_exc()) diff --git a/ingestion/src/metadata/ingestion/source/dashboard/superset/queries.py b/ingestion/src/metadata/ingestion/source/dashboard/superset/queries.py index 1d9f667768a..373045d10ee 100644 --- a/ingestion/src/metadata/ingestion/source/dashboard/superset/queries.py +++ b/ingestion/src/metadata/ingestion/source/dashboard/superset/queries.py @@ -85,5 +85,5 @@ inner join on t.id=tc.table_id where - table_name= '{table_name}' + table_name= %(table_name)s """