Add support for default_profile in [__settings__] section#698
Open
simonfaltum wants to merge 3 commits intomainfrom
Open
Add support for default_profile in [__settings__] section#698simonfaltum wants to merge 3 commits intomainfrom
simonfaltum wants to merge 3 commits intomainfrom
Conversation
Adds support for the __settings__ section in .databrickscfg, enabling default_profile to specify which profile to use when none is explicitly set. The resolved profile is written back to DatabricksConfig so downstream consumers (e.g. DatabricksCliCredentialsProvider) see it. Rejects __settings__ as a profile target to prevent self-referencing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9dd595d to
39ecf38
Compare
Keep default_profile resolution aligned with the other SDKs by preserving the resolved profile name and surfacing bad settings targets instead of silently falling back.
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[__settings__].default_profilein~/.databrickscfgbefore falling back to theDEFAULTsectionauth switchfeatureProfile resolution order:
--profileflag, env var, or programmatic config)[__settings__].default_profile(new)[DEFAULT]section (legacy fallback)Changes
ConfigLoader.java: After parsing the INI file, if no profile is explicitly set, read[__settings__].default_profile. If present and non-empty, use it as the profile name. If the referenced profile section does not exist, throw the same error as an explicit--profilepointing to a missing section.DefaultProfileTest.java: 7 test scenarios covering resolution, precedence, legacy fallback, empty settings, explicit override, settings-not-a-profile, and nonexistent profile error.Test plan
default_profileresolves correctlydefault_profiletakes precedence over[DEFAULT][__settings__]default_profileis empty[__settings__]is not treated as a profile--profileoverridesdefault_profiledefault_profilepointing to nonexistent section throws error