You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/12/13 20:08:30 UTC

[GitHub] [superset] bkyryliuk commented on a change in pull request #17702: chore(sql): clean up invalid filter clause exception types

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-unsubscribe@superset.apache.org

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



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