robdiciuccio commented on a change in pull request #12049:
URL:
https://github.com/apache/incubator-superset/pull/12049#discussion_r546044463
##########
File path: superset/views/core.py
##########
@@ -2506,6 +2514,28 @@ def sql_json_exec( # pylint:
disable=too-many-statements,too-many-locals
f"Query {query_id}: Template syntax error: {error_msg}"
)
+ # pylint: disable=protected-access
+ if is_feature_enabled("ENABLE_TEMPLATE_PROCESSING"):
+ ast = template_processor._env.parse(rendered_query)
+ undefined = find_undeclared_variables(ast) # type: ignore
Review comment:
It's not guaranteed that the template processor with be Jinja-based, due
to how `CUSTOM_TEMPLATE_PROCESSORS` operates. I suggest checking that
`template_processor` is an instance of `JinjaTemplateProcessor` here instead of
checking `ENABLE_TEMPLATE_PROCESSING`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]