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



##########
File path: superset/sql_parse.py
##########
@@ -111,7 +111,16 @@ def is_select(self) -> bool:
         return self._parsed[0].get_type() == "SELECT"
 
     def is_explain(self) -> bool:
-        return self.stripped().upper().startswith("EXPLAIN")
+        # Remove comments
+        statements_without_comments = sqlparse.format(
+            self.stripped(), strip_comments=True
+        )
+
+        # Explain statements will only be the first statement
+        if statements_without_comments.startswith("EXPLAIN"):
+            return True
+
+        return False

Review comment:
       ```suggestion
           return statements_without_comments.startswith("EXPLAIN")
   ```




----------------------------------------------------------------
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]

Reply via email to