Skip to content

Add X-Databricks-Org-Id header to hand-written extensions for SPOG hosts#1389

Closed
simonfaltum wants to merge 2 commits into
mainfrom
simonfaltum/spog-org-id-header
Closed

Add X-Databricks-Org-Id header to hand-written extensions for SPOG hosts#1389
simonfaltum wants to merge 2 commits into
mainfrom
simonfaltum/spog-org-id-header

Conversation

@simonfaltum

Copy link
Copy Markdown
Member

Why

databricks bundle deploy fails on SPOG hosts with "Unable to load OAuth Config" errors when using hand-written extension methods that make direct _api.do() calls. These methods bypass the generated code path that includes the X-Databricks-Org-Id header required for SPOG routing.

The generated service methods already include this header per-call, but the hand-written mixins were missing it.

Linked Go SDK PR: databricks/databricks-sdk-go#1634

Changes

Added the X-Databricks-Org-Id header (when workspace_id is configured) to the following hand-written mixin methods:

  • WorkspaceExt.upload() in mixins/workspace.py
  • WorkspaceExt.download() in mixins/workspace.py
  • SharesExt.list() in mixins/sharing.py
  • ServingEndpointsExt.http_request() in mixins/open_ai_client.py

Uses the same pattern as generated code:

cfg = self._api._cfg
if cfg.workspace_id:
    headers["X-Databricks-Org-Id"] = cfg.workspace_id

Test plan

  • python -c "from databricks.sdk.mixins.workspace import WorkspaceExt" passes
  • All modified files import cleanly

This pull request was AI-assisted by Isaac.

…SPOG host compatibility

Hand-written mixin methods that make direct _api.do() calls were missing
the X-Databricks-Org-Id header that SPOG hosts require for routing.
The generated service methods already include this header per-call, but
Workspace.upload(), Workspace.download(), Shares.list(), and
ServingEndpoints.http_request() were missing it.

Co-authored-by: Isaac
@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: 1389
  • Commit SHA: 19d0b6a3c06a25f2452a8a710134f44417784355

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