eschutho commented on a change in pull request #12049:
URL:
https://github.com/apache/incubator-superset/pull/12049#discussion_r543752535
##########
File path: superset/views/core.py
##########
@@ -2506,6 +2509,32 @@ 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
+ if undefined:
+ error = SupersetError(
+ message=ngettext(
+ "There's an error with the parameter %(parameters)s.
Please check "
+ "your template parameters for syntax errors and make
sure they "
+ "match across your SQL query and Set Parameters. Then,
try "
+ "running your query again.",
+ "There's an error with the parameters %(parameters)s.
Please check "
+ "your template parameters for syntax errors and make
sure they "
+ "match across your SQL query and Set Parameters. Then,
try "
+ "running your query again.",
Review comment:
can we dry up this duplicated string?
----------------------------------------------------------------
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]