Commit 06e9a66
Fix selectSparkVersion() to use contains() instead of equals() (#504)
## What changes are proposed in this pull request?
This PR fixes a bug in the `selectSparkVersion()` method in
`ClustersExt.java` where spark version matching doesn't work with real
Databricks Runtime version names.
The current `equals()` implementation fails because real Databricks
Runtime version names contain additional information. For example, the
actual version name is `"13.3 LTS (includes Apache Spark 3.4.1, Scala
2.12)"`, not just `"Apache Spark 3.4.1"`. Both the Go SDK
(`strings.Contains()`) and Python SDK (`in` operator) use substring
matching for this functionality.
Originally reported in PR #229 with real API response data.
## How is this tested?
Added a focused unit test `sparkVersionWithSparkVersionParameter()` that
demonstrates the fix works with realistic API response data. The test
uses a version name in the actual format returned by the Databricks API:
`"13.3 LTS (includes Apache Spark 3.4.1, Scala 2.12)"`.
Fixes #229
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 72de0ee commit 06e9a66
File tree
3 files changed
+28
-1
lines changed- databricks-sdk-java/src
- main/java/com/databricks/sdk/mixin
- test/java/com/databricks/sdk/mixin
3 files changed
+28
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
121 | 146 | | |
0 commit comments