Skip to content

Commit 5fb5b16

Browse files
committed
Lint issues
1 parent e34c325 commit 5fb5b16

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

databricks/sdk/credentials_provider.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,12 @@ def github_oidc_azure(cfg: 'Config') -> Optional[CredentialsProvider]:
314314
# detect Azure AD Tenant ID if it's not specified directly
315315
token_endpoint = cfg.oidc_endpoints.token_endpoint
316316
cfg.azure_tenant_id = token_endpoint.replace(aad_endpoint, '').split('/')[0]
317-
inner = ClientCredentials(client_id=cfg.azure_client_id,
318-
client_secret="", # we have no (rotatable) secrets in OIDC flow
319-
token_url=f"{aad_endpoint}{cfg.azure_tenant_id}/oauth2/token",
320-
endpoint_params=params,
321-
use_params=True)
317+
inner = ClientCredentials(
318+
client_id=cfg.azure_client_id,
319+
client_secret="", # we have no (rotatable) secrets in OIDC flow
320+
token_url=f"{aad_endpoint}{cfg.azure_tenant_id}/oauth2/token",
321+
endpoint_params=params,
322+
use_params=True)
322323

323324
def refreshed_headers() -> Dict[str, str]:
324325
token = inner.token()

tests/test_model_serving_auth.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,16 @@ def test_model_serving_auth(env_values, del_env_values, oauth_file_name, monkeyp
4848
assert headers.get("Authorization") == 'Bearer databricks_sdk_unit_test_token'
4949

5050

51-
@pytest.mark.parametrize("env_values, oauth_file_name", [
52-
([], "invalid_file_name"), # Not in Model Serving and Invalid File Name
53-
([('IS_IN_DB_MODEL_SERVING_ENV', 'true')], "invalid_file_name"), # In Model Serving and Invalid File Name
54-
([('IS_IN_DATABRICKS_MODEL_SERVING_ENV', 'true')
55-
], "invalid_file_name"), # In Model Serving and Invalid File Name
56-
([], "tests/testdata/model-serving-test-token") # Not in Model Serving and Valid File Name
57-
])
51+
@pytest.mark.parametrize(
52+
"env_values, oauth_file_name",
53+
[
54+
([], "invalid_file_name"), # Not in Model Serving and Invalid File Name
55+
([('IS_IN_DB_MODEL_SERVING_ENV', 'true')
56+
], "invalid_file_name"), # In Model Serving and Invalid File Name
57+
([('IS_IN_DATABRICKS_MODEL_SERVING_ENV', 'true')
58+
], "invalid_file_name"), # In Model Serving and Invalid File Name
59+
([], "tests/testdata/model-serving-test-token") # Not in Model Serving and Valid File Name
60+
])
5861
@raises(default_auth_base_error_message)
5962
def test_model_serving_auth_errors(env_values, oauth_file_name, monkeypatch):
6063
# Guarantee that the tests defaults to env variables rather than config file.

0 commit comments

Comments
 (0)