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/07/06 16:54:12 UTC

[GitHub] [superset] betodealmeida commented on a change in pull request #15403: feat: cancel db query on stop

betodealmeida commented on a change in pull request #15403:
URL: https://github.com/apache/superset/pull/15403#discussion_r664726359



##########
File path: superset/db_engine_specs/base.py
##########
@@ -1303,6 +1303,28 @@ def get_column_spec(
             )
         return None
 
+    @classmethod
+    def get_cancel_query_payload(cls, cursor: Any, query: Query) -> Any:
+        """
+        Returns None if query can not be cancelled.
+        :param cursor: Cursor instance in which the query will be executed
+        :param query: Query instance
+        :return: Type of the payload can vary depends on databases
+        but must be jsonable. None if query can't be cancelled.
+        """
+        return None
+
+    @classmethod
+    def cancel_query(cls, cursor: Any, query: Query, payload: Any) -> None:
+        """
+        Cancels query in the underlying database.
+        The method is called only when payload is not None.
+        :param cursor: New cursor instance to the db of the query
+        :param query: Query instance
+        :param payload: Value returned by get_cancel_query_payload or set in
+        other life-cycle methods of the query
+        """

Review comment:
       Right, a docstring is a valid expression, so need for `pass`. It does look weird, though.




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