Skip to content

feat(snowflake_hook): Adding oauth support for SnowflakeHook#47072

Closed
Sharashchandra wants to merge 1 commit intoapache:mainfrom
Sharashchandra:snowflake_hook_oauth
Closed

feat(snowflake_hook): Adding oauth support for SnowflakeHook#47072
Sharashchandra wants to merge 1 commit intoapache:mainfrom
Sharashchandra:snowflake_hook_oauth

Conversation

@Sharashchandra
Copy link
Copy Markdown
Contributor

This PR enhances the SnowflakeHook in the Airflow repo by completing the OAuth authentication flow. It adds logic to fetch the access token using the refresh_token, client_id, and client_secret, which are already managed in the extras of the Snowflake connection object.

Changes & Fixes:
Implements logic to exchange the refresh_token for a new access token before establishing a connection.
Resolves an issue where using refresh_token, client_id, and client_secret directly with SnowflakeHook results in the error:

snowflake.connector.errors.DatabaseError: 250001 (08001): None: Failed to connect to DB: account.snowflakecomputing.com:443. Invalid OAuth access token.

@boring-cyborg boring-cyborg bot added the provider:snowflake Issues related to Snowflake provider label Feb 25, 2025
@boring-cyborg
Copy link
Copy Markdown

boring-cyborg bot commented Feb 25, 2025

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 pre-commits 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

provider:snowflake Issues related to Snowflake provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant