mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
fix: User-provided Jinja template parameters causing SQL parsing errors (#34802)
(cherry picked from commit e1234b2264)
This commit is contained in:
committed by
Michael S. Molina
parent
878289a2e6
commit
aa69ce43d9
@@ -56,7 +56,7 @@ from superset.models.helpers import (
|
||||
ExtraJSONMixin,
|
||||
ImportExportMixin,
|
||||
)
|
||||
from superset.sql_parse import CtasMethod, extract_tables_from_jinja_sql, Table
|
||||
from superset.sql_parse import CtasMethod, process_jinja_sql, Table
|
||||
from superset.sqllab.limiting_factor import LimitingFactor
|
||||
from superset.utils import json
|
||||
from superset.utils.core import (
|
||||
@@ -80,10 +80,10 @@ class SqlTablesMixin: # pylint: disable=too-few-public-methods
|
||||
def sql_tables(self) -> list[Table]:
|
||||
try:
|
||||
return list(
|
||||
extract_tables_from_jinja_sql(
|
||||
process_jinja_sql(
|
||||
self.sql, # type: ignore
|
||||
self.database, # type: ignore
|
||||
)
|
||||
).tables
|
||||
)
|
||||
except (SupersetSecurityException, SupersetParseError, TemplateError):
|
||||
return []
|
||||
|
||||
Reference in New Issue
Block a user