mirror of
https://github.com/apache/superset.git
synced 2026-05-10 10:25:51 +00:00
feat(sqlparse): improve table parsing (#26476)
(cherry picked from commit c0b57bd1c3)
This commit is contained in:
committed by
Michael S. Molina
parent
6cdaf479f2
commit
1d9cfdabd1
@@ -183,7 +183,7 @@ class Query(
|
||||
|
||||
@property
|
||||
def sql_tables(self) -> list[Table]:
|
||||
return list(ParsedQuery(self.sql).tables)
|
||||
return list(ParsedQuery(self.sql, engine=self.db_engine_spec.engine).tables)
|
||||
|
||||
@property
|
||||
def columns(self) -> list["TableColumn"]:
|
||||
@@ -427,7 +427,9 @@ class SavedQuery(Model, AuditMixinNullable, ExtraJSONMixin, ImportExportMixin):
|
||||
|
||||
@property
|
||||
def sql_tables(self) -> list[Table]:
|
||||
return list(ParsedQuery(self.sql).tables)
|
||||
return list(
|
||||
ParsedQuery(self.sql, engine=self.database.db_engine_spec.engine).tables
|
||||
)
|
||||
|
||||
@property
|
||||
def last_run_humanized(self) -> str:
|
||||
|
||||
Reference in New Issue
Block a user