-
Notifications
You must be signed in to change notification settings - Fork 16.4k
feat(snowflake): add support for cancelling running queries via SQL API #56164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Extend `get_request_url_header_params` to accept optional `url_suffix` for appending endpoint paths (e.g., /cancel). Implement `_cancel_sql_api_query_execution` and `cancel_queries` in `SnowflakeSqlApiHook` to cancel running queries. Add `on_kill` method to `SnowflakeSqlApiOperator` to trigger query cancellation on task kill. Introduce unit test to verify cancel endpoint calls for all query IDs.
Member
|
there is something quite wrong here -> there are no changes in this PR. |
Member
|
Closing it -> just in case we can re-open. |
Contributor
Author
Contributor
Author
|
hi @potiuk could this be reopened please? or is the issue you mentioned before hand still there? |
Member
|
Yeah - that was the "new PR view" having issues. |
Member
|
Any tests? |
Contributor
Author
will add some tests over the weeknd, sorry for the delay |
potiuk
approved these changes
Nov 26, 2025
62 tasks
Copilot AI
pushed a commit
to jason810496/airflow
that referenced
this pull request
Dec 5, 2025
…PI (apache#56164) * feat(snowflake): support cancelling running queries Extend `get_request_url_header_params` to accept optional `url_suffix` for appending endpoint paths (e.g., /cancel). Implement `_cancel_sql_api_query_execution` and `cancel_queries` in `SnowflakeSqlApiHook` to cancel running queries. Add `on_kill` method to `SnowflakeSqlApiOperator` to trigger query cancellation on task kill. Introduce unit test to verify cancel endpoint calls for all query IDs. * Remove Tests * chore: add tests * chore: fix ci/cd
itayweb
pushed a commit
to itayweb/airflow
that referenced
this pull request
Dec 6, 2025
…PI (apache#56164) * feat(snowflake): support cancelling running queries Extend `get_request_url_header_params` to accept optional `url_suffix` for appending endpoint paths (e.g., /cancel). Implement `_cancel_sql_api_query_execution` and `cancel_queries` in `SnowflakeSqlApiHook` to cancel running queries. Add `on_kill` method to `SnowflakeSqlApiOperator` to trigger query cancellation on task kill. Introduce unit test to verify cancel endpoint calls for all query IDs. * Remove Tests * chore: add tests * chore: fix ci/cd
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

This PR introduces cancellation support for Snowflake queries executed through the SQL API:
get_request_url_header_paramsto accept an optionalurl_suffixfor appending endpoint paths (e.g.,/cancelor/result)._cancel_sql_api_query_executionandcancel_queriesmethods toSnowflakeSqlApiHookfor invoking the/cancelendpoint.on_killinSnowflakeSqlApiOperatorto automatically cancel active queries when a task is killed.Closes: #54451