robdiciuccio commented on a change in pull request #12049:
URL: 
https://github.com/apache/incubator-superset/pull/12049#discussion_r546046686



##########
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:
       Other than that, I don't see any security issues with using 
`find_undeclared_variables` in this context. I'm assuming that undefined 
variables don't raise an error during `process_template`?




----------------------------------------------------------------
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]

Reply via email to