fix: Provide more inclusive error handling for saved queries (#27644)

(cherry picked from commit 3ae74d1f2d)
This commit is contained in:
John Bodley
2024-03-27 08:22:14 +13:00
committed by Michael S. Molina
parent 51ad63426c
commit 5c567895cc
3 changed files with 62 additions and 1 deletions

View File

@@ -1072,6 +1072,7 @@ def extract_tables_from_jinja_sql(sql: str, database: Database) -> set[Table]:
:param database: The database associated with the SQL statement
:returns: The set of tables referenced in the SQL statement
:raises SupersetSecurityException: If SQLGlot is unable to parse the SQL statement
:raises jinja2.exceptions.TemplateError: If the Jinjafied SQL could not be rendered
"""
from superset.jinja_context import ( # pylint: disable=import-outside-toplevel