Skip to content

[Internal] Use resolved host type from metadata in host_type property#1372

Open
tanmay-db wants to merge 15 commits intomainfrom
hosttype-resolved
Open

[Internal] Use resolved host type from metadata in host_type property#1372
tanmay-db wants to merge 15 commits intomainfrom
hosttype-resolved

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


Changes

Wire the resolved host type from metadata into the host_type property:

  • Update Config.host_type to return _resolved_host_type (from the
    /.well-known/databricks-config discovery endpoint) when available,
    falling back to the existing URL-based pattern matching when metadata is
    unavailable.
  • Replace the deprecation notice with accurate documentation reflecting
    the new behavior.

This means host_type now correctly returns HostType.UNIFIED for
unified hosts, and can distinguish account vs workspace hosts based on
server metadata rather than URL patterns alone.

Tests

  • Metadata host_type=workspace overrides an account-like URL pattern.
  • Metadata host_type=account overrides a workspace-like URL pattern.
  • Metadata host_type=unified is correctly returned.
  • Falls back to URL-based matching when metadata host_type is missing
    or unrecognized.
  • End-to-end test: metadata resolution → host_type property returns
    metadata value over URL matching.

Signed-off-by: Tanmay Rustagi <tanmay.rustagi@databricks.com>
Signed-off-by: Tanmay Rustagi <tanmay.rustagi@databricks.com>
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:43 — with GitHub Actions Inactive
@tanmay-db tanmay-db changed the title Hosttype resolved [Internal] Use resolved host type from metadata in host_type property Apr 13, 2026
Align the field name with the API contract for the well-known
databricks-config endpoint.

Co-authored-by: Isaac
The API returns this field as an array of strings. Use the first
element when resolving token_audience.

Co-authored-by: Isaac
@tanmay-db tanmay-db temporarily deployed to test-trigger-is April 13, 2026 13:04 — with GitHub Actions Inactive
@tanmay-db tanmay-db marked this pull request as ready for review April 13, 2026 13:12
@tanmay-db tanmay-db deployed to test-trigger-is April 13, 2026 13:18 — with GitHub Actions Active
@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: 1372
  • Commit SHA: 9e7ad052c556a53a425ef69ae4a18205aca15900

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