Skip to content

Added statement timeout support in SnowflakeSqlApiHook & Operator#63575

Open
justinpakzad wants to merge 1 commit intoapache:mainfrom
justinpakzad:add-timeout-to-snowflake-sql-api
Open

Added statement timeout support in SnowflakeSqlApiHook & Operator#63575
justinpakzad wants to merge 1 commit intoapache:mainfrom
justinpakzad:add-timeout-to-snowflake-sql-api

Conversation

@justinpakzad
Copy link
Contributor


Added support for statement-level timeout in the SnowflakeSqlApiHook() and SnowflakeSqlApiOperator(). Default value is set to None and it's only included in the request if provided. As per the docs - if timeout is not provided it will fall back to the STATEMENT_TIMEOUT_IN_SECONDS parameter.

I tested this against my actual Snowflake account and it's working as expected. Also included an additional unit test for the hook.

closes: #60894

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@justinpakzad justinpakzad requested a review from potiuk as a code owner March 14, 2026 02:16
@boring-cyborg boring-cyborg bot added area:providers provider:snowflake Issues related to Snowflake provider labels Mar 14, 2026
@potiuk potiuk added the ready for maintainer review Set after triaging when all criteria pass. label Mar 14, 2026
@henry3260
Copy link
Contributor

Thanks for your PR! While reviewing this, I thought of a couple of edge cases regarding the timeout parameter:

  1. User set timeout over 604800
  2. User set timeout to a negative number

Should we add some validation logic to raise a ValueError for negative numbers and either cap the value at 604800 (with a warning) or raise an error if it exceeds the max limit? This would help us fail fast and provide a better error message to the users.

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 ready for maintainer review Set after triaging when all criteria pass.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Snowflake SQL API: Add support for statement timeout

3 participants