Skip to content

Commit 5c59dec

Browse files
committed
Fix spotless formatting and add NEXT_CHANGELOG entry
1 parent be0e584 commit 5c59dec

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

NEXT_CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Release v0.100.0
44

55
### New Features and Improvements
6+
* Support `default_profile` in `[__settings__]` section of `.databrickscfg` for consistent default profile resolution across CLI and SDKs.
67

78
### Bug Fixes
89

databricks-sdk-java/src/main/java/com/databricks/sdk/core/ConfigLoader.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ static void loadFromConfig(DatabricksConfig cfg) throws IllegalAccessException {
112112
if (!hasExplicitProfile && !hasDefaultProfileSetting) {
113113
profile = "DEFAULT";
114114
}
115-
SubnodeConfiguration section = SETTINGS_SECTION.equals(profile) ? null : ini.getSection(profile);
115+
SubnodeConfiguration section =
116+
SETTINGS_SECTION.equals(profile) ? null : ini.getSection(profile);
116117
boolean sectionNotPresent = section == null || section.isEmpty();
117118
if (sectionNotPresent && !hasExplicitProfile && !hasDefaultProfileSetting) {
118119
LOG.info("{} has no {} profile configured", configFile, profile);

databricks-sdk-java/src/test/java/com/databricks/sdk/DefaultProfileTest.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ private DatabricksConfig createConfigWithMockClient() {
2222
/** Test 1: default_profile resolves correctly and is written back to config */
2323
@Test
2424
public void testDefaultProfileResolvesCorrectly() {
25-
StaticEnv env =
26-
new StaticEnv().with("HOME", TestOSUtils.resource("/testdata/default_profile"));
25+
StaticEnv env = new StaticEnv().with("HOME", TestOSUtils.resource("/testdata/default_profile"));
2726
DatabricksConfig config = createConfigWithMockClient();
2827
resolveConfig(config, env);
2928
config.authenticate();
@@ -37,8 +36,7 @@ public void testDefaultProfileResolvesCorrectly() {
3736
@Test
3837
public void testDefaultProfileTakesPrecedenceOverDefault() {
3938
StaticEnv env =
40-
new StaticEnv()
41-
.with("HOME", TestOSUtils.resource("/testdata/default_profile_precedence"));
39+
new StaticEnv().with("HOME", TestOSUtils.resource("/testdata/default_profile_precedence"));
4240
DatabricksConfig config = createConfigWithMockClient();
4341
resolveConfig(config, env);
4442
config.authenticate();
@@ -132,8 +130,7 @@ public void testExplicitSettingsSectionProfileIsRejected() {
132130
@Test
133131
public void testDefaultProfileNonexistentSection() {
134132
StaticEnv env =
135-
new StaticEnv()
136-
.with("HOME", TestOSUtils.resource("/testdata/default_profile_nonexistent"));
133+
new StaticEnv().with("HOME", TestOSUtils.resource("/testdata/default_profile_nonexistent"));
137134
DatabricksConfig config = createConfigWithMockClient();
138135

139136
DatabricksException ex =

0 commit comments

Comments
 (0)