Skip to content

Conversation

@HyunWooZZ
Copy link
Contributor

Summary

This PR enhances the Snowflake SQL API hook by consistently applying the http_timeout_seconds parameter to both synchronous and asynchronous HTTP requests.
Also it updates retry logic to consider asyncio.TimeoutError retryable.


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

Details

  1. Propagate http_timeout_seconds to requests.Session.request(...) in _make_api_call_with_retries.
  2. Configure aiohttp.ClientSession with ClientTimeout(total=...) when http_timeout_seconds is provided.
  3. Expand _should_retry_on_error to treat asyncio.TimeoutError as retryable.
  4. Refactor request kwargs construction to reduce duplication and centralize timeout behavior.

Tests

  • Verified timeout propagation for synchronous HTTP requests.
  • Checked that async ClientSession is configured with the expected timeout.
  • Ensured async requests are retried on timeout errors.

Sync retry behavior is already extensively covered by existing tests..
So, this PR adds coverage for timeout propagation and async timeout retries.

@HyunWooZZ HyunWooZZ requested a review from potiuk as a code owner January 17, 2026 09:46
@boring-cyborg
Copy link

boring-cyborg bot commented Jan 17, 2026

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@boring-cyborg boring-cyborg bot added area:providers provider:snowflake Issues related to Snowflake provider labels Jan 17, 2026
Copy link
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable for me but as I have no Snowflake experience I'd ask some additional pair of eyes

@eladkal eladkal changed the title Snowflake: At SQL API hook apply http_timeout_seconds to sync/async requests and treat asyncio.TimeoutError as retryable. feat(snowflake): add HTTP request customization parameters to SnowflakeSqlApiHook Jan 21, 2026
@eladkal eladkal changed the title feat(snowflake): add HTTP request customization parameters to SnowflakeSqlApiHook (feat): add HTTP request customization parameters to SnowflakeSqlApiHook Jan 21, 2026
@eladkal eladkal merged commit f4c3591 into apache:main Jan 21, 2026
88 checks passed
@boring-cyborg
Copy link

boring-cyborg bot commented Jan 21, 2026

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

suii2210 pushed a commit to suii2210/airflow that referenced this pull request Jan 26, 2026
…Hook` (apache#60689)

* Add http_request_kwargs, aiohttp_session_kwargs, and aiohttp_request_kwargs parameters to allow customization of HTTP requests for both sync and async operations.
shreyas-dev pushed a commit to shreyas-dev/airflow that referenced this pull request Jan 29, 2026
…Hook` (apache#60689)

* Add http_request_kwargs, aiohttp_session_kwargs, and aiohttp_request_kwargs parameters to allow customization of HTTP requests for both sync and async operations.
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.

4 participants