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



##########
File path: superset/db_engine_specs/snowflake.py
##########
@@ -128,3 +129,34 @@ def mutate_db_for_connection_test(database: "Database") -> 
None:
         engine_params["connect_args"] = connect_args
         extra["engine_params"] = engine_params
         database.extra = json.dumps(extra)
+
+    @classmethod
+    def get_cancel_query_id(cls, cursor: Any, query: Query) -> Optional[str]:
+        """
+        Get Snowflake session ID that will be used to cancel all other running
+        queries in the same session.
+
+        :param cursor: Cursor instance in which the query will be executed
+        :param query: Query instance
+        :return: Snowflake Session ID
+        """
+        cursor.execute("SELECT CURRENT_SESSION()")

Review comment:
       @koszti does this work? The reason I ask is per the documentation, 
[CURRENT_SESSION](https://docs.snowflake.com/en/sql-reference/functions/current_session.html)
   
   > Returns a unique system identifier for the Snowflake session corresponding 
to the present connection
   
   yet the connection associated with said cursor is not the same connection 
which instantiated the query (in all likelihood for async queries that 
connection resides on a Celery host). Thus I would suspect there are actually 
no queries running within the current session.  




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