Skip to content

[Internal] Add host_type to HostMetadata #1370

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

[Internal] Add host_type 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

🥞 Stacked PR

Use this link to review incremental changes.


Changes

Add host_type support to the SDK's host metadata discovery flow:

  • Add host_type field to the HostMetadata dataclass, parsed from the /.well-known/databricks-config discovery endpoint response.
  • Add HostType.from_api_value() static method to normalize host type strings ("workspace", "account", "unified") from the API into HostType enum values
    with case-insensitive matching.
  • In Config._resolve_host_metadata(), populate a new _resolved_host_type attribute from the metadata's host_type field (does not overwrite if already set).

Tests

  • Parametrized tests for HostType.from_api_value() covering all valid values, case variants, unknown strings, empty, and None.
  • Tests for HostMetadata.from_dict with and without host_type.
  • Tests for _resolve_host_metadata populating _resolved_host_type: happy path (unified), no-overwrite, missing metadata, and unknown strings.

Signed-off-by: Tanmay Rustagi <tanmay.rustagi@databricks.com>
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.

@tanmay-db tanmay-db changed the title Add HostType to HostMetadata [Internal] Add host_type to HostMetadata Apr 13, 2026
@tanmay-db tanmay-db marked this pull request as ready for review April 13, 2026 13:12
Copy link
Copy Markdown
Contributor

@hectorcast-db hectorcast-db left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this?
Unlike Go/TF, Python doesn't use the HostType at all.

@tanmay-db
Copy link
Copy Markdown
Contributor Author

The changes were created to have consistency with Go SDK, since we don't need it right now, closing the PR

@tanmay-db tanmay-db closed this Apr 14, 2026
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.

2 participants