LevisNgigi commented on code in PR #35009:
URL: https://github.com/apache/superset/pull/35009#discussion_r2324715979
##########
superset/sqllab/query_render.py:
##########
@@ -74,6 +74,14 @@ def _validate(
sql_template_processor: BaseTemplateProcessor,
) -> None:
if is_feature_enabled("ENABLE_TEMPLATE_PROCESSING"):
+ original_sql = execution_context.query.sql.strip().strip(";")
+ if rendered_query == original_sql:
+ import re
+
+ function_pattern = r"\{\{\s*(ref|source|var|env_var)\s*\("
+ if re.search(function_pattern, original_sql, re.IGNORECASE):
+ return
Review Comment:
Thank you, I updated the validation logic so that it first strips comment
blocks from original_sql before performing the uncleared_variable check. That
way, we don’t skip the entire validation when encountering Jinja declarations,
but still preserve the intended behavior.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]