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 2020/10/20 18:37:36 UTC

[GitHub] [incubator-superset] mistercrunch commented on a change in pull request #11348: fix: Allow "EXPLAIN" queries when "Allow DML" setting is False

mistercrunch commented on a change in pull request #11348:
URL: https://github.com/apache/incubator-superset/pull/11348#discussion_r508753394



##########
File path: superset/sql_parse.py
##########
@@ -111,7 +111,11 @@ def is_select(self) -> bool:
         return self._parsed[0].get_type() == "SELECT"
 
     def is_explain(self) -> bool:
-        return self.stripped().upper().startswith("EXPLAIN")
+        # Parsing SQL statement for EXPLAIN and filtering out comments

Review comment:
       Thinking about whether the right logic here is `first()`, `any()` or `all()` and I think it's either 
   
   - 1) it works only if the SQL is a single statement, and raises otherwise
   - 2) all of the statements are `EXPLAIN` (which is not typical)
   




----------------------------------------------------------------
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:
users@infra.apache.org



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