Skip to content

Commit a3879bf

Browse files
committed
private
1 parent 05d69b9 commit a3879bf

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

databricks/sdk/_base_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
logger = logging.getLogger('databricks.sdk')
1919

2020

21-
def fix_host_if_needed(host: Optional[str]) -> Optional[str]:
21+
def _fix_host_if_needed(host: Optional[str]) -> Optional[str]:
2222
if not host:
2323
return host
2424

databricks/sdk/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import requests
1111

1212
from . import useragent
13-
from ._base_client import fix_host_if_needed
13+
from ._base_client import _fix_host_if_needed
1414
from .clock import Clock, RealClock
1515
from .credentials_provider import CredentialsStrategy, DefaultCredentials
1616
from .environments import (ALL_ENVS, AzureEnvironment, Cloud,
@@ -121,7 +121,7 @@ def __init__(self,
121121
self._set_inner_config(kwargs)
122122
self._load_from_env()
123123
self._known_file_config_loader()
124-
updated_host = fix_host_if_needed(self.host)
124+
updated_host = _fix_host_if_needed(self.host)
125125
if updated_host:
126126
self.host = updated_host
127127
self._validate()

databricks/sdk/oauth.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import requests
1818
import requests.auth
1919

20-
from ._base_client import _BaseClient, fix_host_if_needed
20+
from ._base_client import _BaseClient, _fix_host_if_needed
2121

2222
# Error code for PKCE flow in Azure Active Directory, that gets additional retry.
2323
# See https://stackoverflow.com/a/75466778/277035 for more info
@@ -245,7 +245,7 @@ def get_account_endpoints(host: str, account_id: str, client: _BaseClient = _Bas
245245
:param account_id: The account ID.
246246
:return: The account's OIDC endpoints.
247247
"""
248-
host = fix_host_if_needed(host)
248+
host = _fix_host_if_needed(host)
249249
oidc = f'{host}/oidc/accounts/{account_id}/.well-known/oauth-authorization-server'
250250
resp = client.do('GET', oidc)
251251
return OidcEndpoints.from_dict(resp)
@@ -257,7 +257,7 @@ def get_workspace_endpoints(host: str, client: _BaseClient = _BaseClient()) -> O
257257
:param host: The Databricks workspace host.
258258
:return: The workspace's OIDC endpoints.
259259
"""
260-
host = fix_host_if_needed(host)
260+
host = _fix_host_if_needed(host)
261261
oidc = f'{host}/oidc/.well-known/oauth-authorization-server'
262262
resp = client.do('GET', oidc)
263263
return OidcEndpoints.from_dict(resp)
@@ -271,7 +271,7 @@ def get_azure_entra_id_workspace_endpoints(host: str) -> Optional[OidcEndpoints]
271271
:return: The OIDC endpoints for the workspace's Azure Entra ID tenant.
272272
"""
273273
# In Azure, this workspace endpoint redirects to the Entra ID authorization endpoint
274-
host = fix_host_if_needed(host)
274+
host = _fix_host_if_needed(host)
275275
res = requests.get(f'{host}/oidc/oauth2/v2.0/authorize', allow_redirects=False)
276276
real_auth_url = res.headers.get('location')
277277
if not real_auth_url:

0 commit comments

Comments
 (0)