Skip to content

Add HostType to HostMetadata#1370

Draft
tanmay-db wants to merge 3 commits intomainfrom
hosttype-metadata
Draft

Add HostType to HostMetadata#1370
tanmay-db wants to merge 3 commits intomainfrom
hosttype-metadata

Conversation

@tanmay-db
Copy link
Copy Markdown
Contributor

@tanmay-db tanmay-db commented Mar 30, 2026

Python SDK — PR #1370: [Internal] Add HostType to HostMetadata

🥞 Stacked PR


Summary

Parses the host_type field from the /.well-known/databricks-config discovery endpoint into
HostMetadata and stores it on Config, so the SDK knows whether a host is a workspace,
account, or unified host without parsing hostnames.

Why

Today, the host_type property infers the host type by prefix-matching the hostname against
accounts. — everything else is classified as WORKSPACE. This cannot detect unified hosts,
which share the same hostname pattern as workspace hosts.

The server-side host_type field is being added to the /.well-known/databricks-config
endpoint, returning "workspace", "account", or "unified". This PR threads that value
into the SDK so it's available for use when the host_type property is updated to prefer
endpoint-resolved values over URL-based inference (PR #1372).

What changed

Interface changes

  • HostType.from_api_value(value) — new static method that normalizes API values
    (workspace, account, unified) to enum constants. Case-insensitive. Returns None for
    unknown values.
  • HostMetadata.host_type — new field parsed from the discovery endpoint response.

Behavioral changes

  • _resolve_host_metadata() now populates Config._resolved_host_type from the discovery
    endpoint if not already set. The host_type property is not yet modified to use this
    value — that is PR Hosttype resolved #1372 in this stack.

Internal changes

  • Config._resolved_host_type stores the host type resolved during
    _resolve_host_metadata().

How is this tested?

  • 18 unit tests covering from_api_value() normalization, HostMetadata.from_dict() parsing,
    _resolve_host_metadata population, and does-not-overwrite semantics.

NO_CHANGELOG=true


Signed-off-by: Tanmay Rustagi <tanmay.rustagi@databricks.com>
@tanmay-db tanmay-db temporarily deployed to test-trigger-is March 30, 2026 15:12 — with GitHub Actions Inactive
@tanmay-db tanmay-db temporarily deployed to test-trigger-is March 30, 2026 15:13 — with GitHub Actions Inactive
This was referenced Mar 30, 2026
Signed-off-by: Tanmay Rustagi <tanmay.rustagi@databricks.com>
@tanmay-db tanmay-db temporarily deployed to test-trigger-is April 11, 2026 10:20 — with GitHub Actions Inactive
@github-actions
Copy link
Copy Markdown

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: 1370
  • Commit SHA: 32e3131473be4c2833c4adf8f70c779232f9a8fb

Checks will be approved automatically on success.

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.

1 participant