bugraoz93 commented on code in PR #49482:
URL: https://github.com/apache/airflow/pull/49482#discussion_r2054771508
##########
providers/snowflake/src/airflow/providers/snowflake/hooks/snowflake_sql_api.py:
##########
@@ -232,29 +221,15 @@ def get_headers(self) -> dict[str, Any]:
}
return headers
- def get_oauth_token(self, conn_config: dict[str, Any]) -> str:
+ def get_oauth_token(self, conn_config: dict[str, Any] | None = None) ->
str:
"""Generate temporary OAuth access token using refresh token in
connection details."""
- url =
f"{self.account_identifier}.snowflakecomputing.com/oauth/token-request"
- data = {
- "grant_type": "refresh_token",
- "refresh_token": conn_config["refresh_token"],
- "redirect_uri": conn_config.get("redirect_uri",
"https://localhost.com"),
- }
- response = requests.post(
- url,
- data=data,
- headers={
- "Content-Type": "application/x-www-form-urlencoded",
- },
- auth=HTTPBasicAuth(conn_config["client_id"],
conn_config["client_secret"]), # type: ignore[arg-type]
+ warnings.warn(
+ "This method is deprecated. Please use `get_oauth_token` method
from `SnowflakeHook` instead. "
+ "It will be removed in apache-airflow-providers-snowflake:6.4.0.",
Review Comment:
Thanks for the review, Elad!
No solid reason, that's why I asked if we have any common approach for this
https://github.com/apache/airflow/pull/49482#discussion_r2051789753. I put this
out there to discuss and get your take. Good to learn it will be checked in the
next major :)
I updated the warning accordingly
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]