Skip to content

Commit

Permalink
Rename to SessionCredentials to follow new databricks-sdk version
Browse files Browse the repository at this point in the history
Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
  • Loading branch information
susodapop committed May 17, 2023
1 parent 8a66a4d commit fd23a29
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dbt/adapters/databricks/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
from dbt.adapters.databricks.utils import redact_credentials

from databricks.sdk.core import CredentialsProvider
from databricks.sdk.oauth import OAuthClient, RefreshableCredentials
from databricks.sdk.oauth import OAuthClient, SessionCredentials
from dbt.adapters.databricks.auth import token_auth, m2m_auth

import keyring
Expand Down Expand Up @@ -302,7 +302,7 @@ def authenticate(self, in_provider: CredentialsProvider) -> CredentialsProvider:
credsdict = keyring.get_password("dbt-databricks", host)

if credsdict:
provider = RefreshableCredentials.from_dict(oauth_client, json.loads(credsdict))
provider = SessionCredentials.from_dict(oauth_client, json.loads(credsdict))
# if refresh token is expired, this will throw
try:
if provider.token().valid:
Expand Down Expand Up @@ -355,7 +355,7 @@ def _provider_from_dict(self) -> CredentialsProvider:
scopes=SCOPES,
)

return RefreshableCredentials.from_dict(client=oauth_client, raw=self._credentials_provider)
return SessionCredentials.from_dict(client=oauth_client, raw=self._credentials_provider)


class DatabricksSQLConnectionWrapper:
Expand Down

0 comments on commit fd23a29

Please sign in to comment.