Skip to content

Commit 943f538

Browse files
fix(kernel): make auth_bridge.py pass black + mypy
Two quality-check regressions from the azure-sp-m2m addition: - mypy [no-redef]: the new azure-sp-m2m branch's `kwargs` assignment now precedes the JWT branch's annotated `kwargs: Dict[str, Any]`. Move the annotation onto the first (azure-sp-m2m) assignment so the later ones are plain reassignments to the same annotated name. - black: split the over-long `ignored_signals` tuple. Verified locally: `black --check src` clean, `mypy src` reports no issues. Co-authored-by: Isaac Signed-off-by: eric-wang-1990 <e.wang@databricks.com>
1 parent c344325 commit 943f538

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/databricks/sql/backend/kernel/auth_bridge.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,11 @@ def kernel_auth_kwargs(
278278
# and those values are silently ignored here.
279279
ignored_signals = [
280280
name
281-
for name in ("oauth_client_secret", "oauth_jwt_key_file", "credentials_provider")
281+
for name in (
282+
"oauth_client_secret",
283+
"oauth_jwt_key_file",
284+
"credentials_provider",
285+
)
282286
if opts.get(name) is not None
283287
]
284288
if ignored_signals:
@@ -288,7 +292,7 @@ def kernel_auth_kwargs(
288292
"namespace take precedence on the kernel path).",
289293
", ".join(ignored_signals),
290294
)
291-
kwargs = {
295+
kwargs: Dict[str, Any] = {
292296
"auth_type": "azure-sp-m2m",
293297
"azure_client_id": azure_client_id,
294298
"azure_client_secret": azure_client_secret,
@@ -371,7 +375,7 @@ def kernel_auth_kwargs(
371375
"requires oauth_jwt_kid (the key id written into the JWT "
372376
"header so the IdP can select the registered public key)."
373377
)
374-
kwargs: Dict[str, Any] = {
378+
kwargs = {
375379
"auth_type": "oauth-m2m-jwt",
376380
"client_id": client_id,
377381
"jwt_key_file": jwt_key_file,

0 commit comments

Comments
 (0)