bkyryliuk commented on a change in pull request #17702:
URL: https://github.com/apache/superset/pull/17702#discussion_r768084399



##########
File path: superset/sql_parse.py
##########
@@ -378,3 +380,23 @@ def set_or_update_query_limit(self, new_limit: int, force: 
bool = False) -> str:
         for i in statement.tokens:
             str_res += str(i.value)
         return str_res
+
+
+def validate_filter_clause(clause: str) -> None:
+    if sqlparse.format(clause, strip_comments=True) != sqlparse.format(clause):
+        raise QueryClauseValidationException("Filter clause contains comment")

Review comment:
       @villebro is this intended ? this exception broke a number of our 
dashboards and seems to be a valid use case for the where clause sql. e.g. 
comment out different filter options while iterating on the chart




-- 
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: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to