Fixes 13343: Fix Superset table name issue (#14714)

This commit is contained in:
Ayush Shah 2024-01-15 18:19:27 +05:30 committed by GitHub
parent 98eae7154a
commit 709fa7415f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -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())

View File

@ -85,5 +85,5 @@ inner join
on
t.id=tc.table_id
where
table_name= '{table_name}'
table_name= %(table_name)s
"""