Skip to content

Add DATABRICKS_OIDC_TOKEN_FILEPATH env var support#1334

Merged
renaudhartert-db merged 3 commits intomainfrom
oidc-token-filepath-alias
Mar 20, 2026
Merged

Add DATABRICKS_OIDC_TOKEN_FILEPATH env var support#1334
renaudhartert-db merged 3 commits intomainfrom
oidc-token-filepath-alias

Conversation

@renaudhartert-db
Copy link
Contributor

Summary

The Go SDK, CLI, and Terraform all use DATABRICKS_OIDC_TOKEN_FILEPATH, while the Python SDK used DATABRICKS_OIDC_TOKEN_FILE. This mismatch caused silent failures for users coming from Go/CLI/Terraform.

This PR:

  • Adds an env_aliases mechanism to ConfigAttribute so a config field can be loaded from multiple env vars with clear precedence (primary > alias)
  • Makes DATABRICKS_OIDC_TOKEN_FILEPATH the primary env var, keeping DATABRICKS_OIDC_TOKEN_FILE as a backward-compatible alias
  • Reports alias usage in debug_string output

Test plan

  • Alias loads when primary is not set
  • Primary takes precedence over alias when both are set
  • Constructor arg takes precedence over both env vars

The Go SDK, CLI, and Terraform all use `DATABRICKS_OIDC_TOKEN_FILEPATH`,
while the Python SDK used `DATABRICKS_OIDC_TOKEN_FILE`. This mismatch
caused silent failures for users coming from Go/CLI/Terraform.

Make `DATABRICKS_OIDC_TOKEN_FILEPATH` the primary env var and keep
`DATABRICKS_OIDC_TOKEN_FILE` as a backward-compatible alias via a new
`env_aliases` mechanism on `ConfigAttribute`.

Co-authored-by: Isaac
@github-actions
Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/sdk-py

Inputs:

  • PR number: 1334
  • Commit SHA: b70f6d4b2b15e11d9234547d56aced7bf1ac2e4e

Checks will be approved automatically on success.

@renaudhartert-db renaudhartert-db requested review from mihaimitrea-db and removed request for hectorcast-db March 18, 2026 16:47
@renaudhartert-db renaudhartert-db added this pull request to the merge queue Mar 20, 2026
Merged via the queue into main with commit 2fa3228 Mar 20, 2026
17 checks passed
@renaudhartert-db renaudhartert-db deleted the oidc-token-filepath-alias branch March 20, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants