villebro commented on code in PR #21035:
URL: https://github.com/apache/superset/pull/21035#discussion_r943656346
##########
superset/db_engine_specs/trino.py:
##########
@@ -127,14 +129,42 @@ def get_tracking_url(cls, cursor: "Cursor") ->
Optional[str]:
return None
@classmethod
- def handle_cursor(cls, cursor: "Cursor", query: Query, session: Session)
-> None:
- """Updates progress information"""
+ def handle_cursor(cls, cursor: Cursor, query: Query, session: Session) ->
None:
tracking_url = cls.get_tracking_url(cursor)
if tracking_url:
query.tracking_url = tracking_url
- session.commit()
+
+ # Adds the executed query id to the extra payload so the query can be
cancelled
+ query.set_extra_json_key("cancel_query", cursor.stats["queryId"])
Review Comment:
Calling it `cancel_query` is the currently established convention: It's
declared
[here](https://github.com/apache/superset/blob/42a5375e83087c738555a05044419b812f0f4f99/superset/sql_lab.py#L72)
and later used
[here](https://github.com/apache/superset/blob/42a5375e83087c738555a05044419b812f0f4f99/superset/sql_lab.py#L622)
and
[here](https://github.com/apache/superset/blob/42a5375e83087c738555a05044419b812f0f4f99/superset/sql_lab.py#L630-L632)
. The reason why we aren't placing this logic in `get_cancel_query_id` like
other engines is because the id isn't available on Trino when that method is
called.
--
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]