-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Snowflake SQL API hook Retry Logic #51463
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
Snowflake SQL API hook Retry Logic #51463
Conversation
providers/snowflake/src/airflow/providers/snowflake/hooks/snowflake_sql_api.py
Outdated
Show resolved
Hide resolved
providers/snowflake/src/airflow/providers/snowflake/hooks/snowflake_sql_api.py
Outdated
Show resolved
Hide resolved
providers/snowflake/src/airflow/providers/snowflake/hooks/snowflake_sql_api.py
Outdated
Show resolved
Hide resolved
Hey @mik-laj, would you be able to take another look at this soon? Thank you! |
Hey @mik-laj, I've updated the implementation to use context managers for both the http session and the retrying object. Thank you for the feedback and let me know what you think of the updates 🙌 |
7ddc037
to
d892811
Compare
providers/snowflake/src/airflow/providers/snowflake/operators/snowflake.py
Show resolved
Hide resolved
6ea7b09
to
e44cd77
Compare
e44cd77
to
088fc17
Compare
* added retry logic for sync and async requests to snowflake api * first draft of unit tests * unit tests for hook and retries * remove comment * update sync request to use request.request * mypy fixes * updated sync and async api call methods to use tenacity context manager * update unit test with correct method * retry args docs * reorder so self.log is initialized
Hi @astro-anand do you happen to know when this will be released? |
We usually release provider's every 2 weeks (See the README). We have one release in progress (see devlist) so you might expect the next wave within 2 weeks. But you can also - and we encourage you to - to build your own provider, it's super easy (there are a number of ways - starting from Also when voting on the new provider starts (you should observe devlist and there will be github issue) you are encouraged to test and see the RC candidate (and let us know when you did) |
Updated sync and async Snowflake API call methods to retry on errors as advised by Snowflake (https://docs.snowflake.com/en/developer-guide/sql-api/handling-errors) and on connection related errors.
closes: #50514
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in airflow-core/newsfragments.