Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def _get_field(self, extra_dict, field_name):

@property
def account_identifier(self) -> str:
"""Returns snowflake account identifier."""
"""Get snowflake account identifier."""
conn_config = self._get_conn_params
account_identifier = f"https://{conn_config['account']}"

Expand All @@ -205,7 +205,7 @@ def get_oauth_token(self, conn_config: dict | None = None) -> str:
if conn_config is None:
conn_config = self._get_conn_params

url = f"{self.account_identifier}.snowflakecomputing.com/oauth/token-request"
url = f"https://{conn_config['account']}.snowflakecomputing.com/oauth/token-request"

data = {
"grant_type": "refresh_token",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ def test_get_oauth_token(self, mock_conn_param, requests_post, mock_auth):
hook = SnowflakeHook(snowflake_conn_id="mock_conn_id")
hook.get_oauth_token(conn_config=CONN_PARAMS_OAUTH)
requests_post.assert_called_once_with(
f"https://{CONN_PARAMS_OAUTH['account']}.{CONN_PARAMS_OAUTH['region']}.snowflakecomputing.com/oauth/token-request",
f"https://{CONN_PARAMS_OAUTH['account']}.snowflakecomputing.com/oauth/token-request",
data={
"grant_type": "refresh_token",
"refresh_token": CONN_PARAMS_OAUTH["refresh_token"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def test_get_oauth_token(self, mock_conn_param, requests_post, mock_auth):
with pytest.warns(expected_warning=AirflowProviderDeprecationWarning):
hook.get_oauth_token(CONN_PARAMS_OAUTH)
requests_post.assert_called_once_with(
f"https://{CONN_PARAMS_OAUTH['account']}.{CONN_PARAMS_OAUTH['region']}.snowflakecomputing.com/oauth/token-request",
f"https://{CONN_PARAMS_OAUTH['account']}.snowflakecomputing.com/oauth/token-request",
data={
"grant_type": "refresh_token",
"refresh_token": CONN_PARAMS_OAUTH["refresh_token"],
Expand Down