Draft
Conversation
Signed-off-by: Tanmay Rustagi <tanmay.rustagi@databricks.com>
This was referenced Mar 30, 2026
Signed-off-by: Tanmay Rustagi <tanmay.rustagi@databricks.com>
Signed-off-by: Tanmay Rustagi <tanmay.rustagi@databricks.com>
|
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.
🥞 Stacked PR
Summary
Parses the
host_typefield from the/.well-known/databricks-configdiscovery endpoint intoHostMetadataand stores it onDatabricksConfig, so the SDK knows whether a host is aworkspace, account, or unified host without parsing hostnames.
Why
Today,
getHostType()infers the host type by prefix-matching the hostname againstaccounts.— everything else is classified asWORKSPACE. This cannot detect unified hosts,which share the same hostname pattern as workspace hosts.
The server-side
host_typefield is being added to the/.well-known/databricks-configendpoint, returning
"workspace","account", or"unified". This PR threads that valueinto the SDK so it's available for use when
getHostType()is updated to preferendpoint-resolved values over URL-based inference (PR #749).
What changed
Interface changes
HostType.fromApiValue(String)— new static method that normalizes API values(
workspace,account,unified) to enum constants (WORKSPACE,ACCOUNTS,UNIFIED).Case-insensitive. Returns
nullfor unknown values.HostMetadata.getHostType()— new getter for thehost_typefield parsed from thediscovery endpoint response.
Behavioral changes
resolveHostMetadata()now populatesDatabricksConfig.resolvedHostTypefrom the discoveryendpoint if not already set.
getHostType()is not yet modified to use this value — thatis PR [Internal] Use resolved host type from host metadata in getHostType() #749 in this stack.
Internal changes
DatabricksConfig.resolvedHostType(package-private) stores the host type resolved duringresolveHostMetadata().DatabricksConfig.getResolvedHostType()/setResolvedHostType()— package-privateaccessor for testing.
How is this tested?
HostTypeTest— 7 tests forfromApiValue()normalization (all cases, case-insensitive,null, empty, unknown values)
DatabricksConfigTest— 5 tests for host type resolution from metadata (populatesworkspace/account/unified, does not overwrite existing, unknown ignored)
NO_CHANGELOG=true