Skip to content

Conversation

@prdai
Copy link
Contributor

@prdai prdai commented Sep 27, 2025

This PR introduces cancellation support for Snowflake queries executed through the SQL API:

  • Extend get_request_url_header_params to accept an optional url_suffix for appending endpoint paths (e.g., /cancel or /result).
  • Add _cancel_sql_api_query_execution and cancel_queries methods to SnowflakeSqlApiHook for invoking the /cancel endpoint.
  • Implement on_kill in SnowflakeSqlApiOperator to automatically cancel active queries when a task is killed.

Closes: #54451

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.
@boring-cyborg boring-cyborg bot added area:providers provider:snowflake Issues related to Snowflake provider labels Sep 27, 2025
@potiuk
Copy link
Member

potiuk commented Oct 11, 2025

there is something quite wrong here -> there are no changes in this PR.

@potiuk
Copy link
Member

potiuk commented Oct 11, 2025

Closing it -> just in case we can re-open.

@potiuk potiuk closed this Oct 11, 2025
@prdai
Copy link
Contributor Author

prdai commented Oct 11, 2025

image

hi, there should be changes, weird that you can't see the changes :\ it shows for me the changes

@prdai
Copy link
Contributor Author

prdai commented Oct 12, 2025

hi @potiuk could this be reopened please? or is the issue you mentioned before hand still there?

@potiuk potiuk reopened this Oct 13, 2025
@potiuk
Copy link
Member

potiuk commented Oct 13, 2025

Yeah - that was the "new PR view" having issues.

@potiuk
Copy link
Member

potiuk commented Oct 13, 2025

Any tests?

@prdai
Copy link
Contributor Author

prdai commented Oct 16, 2025

Any tests?

will add some tests over the weeknd, sorry for the delay

@potiuk potiuk merged commit 7255450 into apache:main Nov 26, 2025
83 checks passed
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

Labels

area:providers provider:snowflake Issues related to Snowflake provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

clearing/failing SnowflakeSqlApiOperator task should also kill external query running on Snowflake

2 participants