john-bodley commented on a change in pull request #15878:
URL: https://github.com/apache/superset/pull/15878#discussion_r675890141



##########
File path: superset/sql_lab.py
##########
@@ -587,23 +587,30 @@ def cancel_query(query: Query, user_name: Optional[str] = 
None) -> bool:
     """
     Cancel a running query.
 
+    Note some engines implicitly handle the cancelation of a query and thus no 
expliicit
+    action is required.
+
     :param query: Query to cancel
     :param user_name: Default username
     :return: True if query cancelled successfully, False otherwise
     """
-    cancel_query_id = query.extra.get(cancel_query_key, None)
+
+    if query.database.db_engine_spec.has_implicit_cancel():
+        return True
+
+    cancel_query_id = query.extra.get(cancel_query_key)
     if cancel_query_id is None:
         return False
 
-    database = query.database
-    engine = database.get_sqla_engine(
+    engine = query.database.get_sqla_engine(

Review comment:
       Removing interim variables which likely add unnecessary obfuscation.




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

Reply via email to