mirror of
https://github.com/apache/superset.git
synced 2026-09-01 13:01:33 +00:00
check_query_access() calls raise_for_access(query=query), which Jinja-renders the query's SQL to resolve table references. A malformed template surfaces as a raw jinja2.exceptions.TemplateError instead of a Superset exception, leaking as an opaque 500 from the explore form_data endpoints (used by the chart Explore/Drill-by cache) whenever datasource_type=query. Wrap the call and re-raise as the existing SupersetTemplateException (422), matching the same conversion already used in datasets/api.py, and map it to a proper response in ExploreFormDataRestApi's four handlers.