Skip to content

Add X-Databricks-Org-Id header to SharesExtImpl.list() for SPOG#772

Merged
hectorcast-db merged 1 commit intomainfrom
hector/shares-ext-org-id-header
Apr 21, 2026
Merged

Add X-Databricks-Org-Id header to SharesExtImpl.list() for SPOG#772
hectorcast-db merged 1 commit intomainfrom
hector/shares-ext-org-id-header

Conversation

@hectorcast-db
Copy link
Copy Markdown
Contributor

Summary

Ports databricks/databricks-sdk-go#1635 and the applicable piece of databricks/databricks-sdk-py#1397 to the Java SDK.

SharesExtImpl.list() is a hand-written extension that calls apiClient.execute() directly and was missing the X-Databricks-Org-Id request header. On SPOG hosts this causes the call to fail with:

Error: Unable to load OAuth Config (400 UNKNOWN)

Generated service methods already set this header when cfg.workspaceId is populated (see any *Impl.java under service/, e.g. WorkspaceImpl.export() / importContent() or SharesImpl.create()). This change brings the hand-written extension in line.

Scope vs. the Python PR

databricks-sdk-py#1397 contains three fixes; only one applies to Java:

Python fix Applies to Java?
SharesExt.list() missing X-Databricks-Org-Id ✅ ported here
WorkspaceExt.upload() / WorkspaceExt.download() missing header ❌ no equivalent — Java has no hand-written WorkspaceExt; generated WorkspaceImpl.export() / importContent() already include the header
WorkspaceClient.get_workspace_id() short-circuit ❌ no equivalent — Java WorkspaceClient has no getWorkspaceId() method

Test plan

  • mvn compile clean
  • Spotless clean
  • Integration tests on a SPOG host (requires a real SPOG workspace)

No dedicated unit test added, matching the Go PR (#1635) and Python PR which applied the same pattern without one — there is no test infrastructure for asserting per-request headers on the hand-written extensions.

This pull request was AI-assisted by Isaac.

Hand-written extension methods in the mixins bypass the generated
per-call header logic. On SPOG hosts, requests without
X-Databricks-Org-Id are rejected by the proxy with:

    Error: Unable to load OAuth Config (400 UNKNOWN)

Generated service methods (e.g. WorkspaceImpl.export/importContent,
SharesImpl.* generated endpoints) already set this header when
cfg.workspaceId is populated. This change brings the hand-written
SharesExtImpl.list() in line.

Ports databricks/databricks-sdk-go#1635. The other two fixes from
databricks/databricks-sdk-py#1397 do not apply to Java:
- WorkspaceExt.upload/download: no hand-written Java equivalent; the
  generated WorkspaceImpl.export()/importContent() already set the
  header on every call.
- WorkspaceClient.get_workspace_id() short-circuit: Java WorkspaceClient
  has no equivalent method.

Co-authored-by: Isaac
@github-actions
Copy link
Copy Markdown
Contributor

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-java

Inputs:

  • PR number: 772
  • Commit SHA: 35bc28ab903018eddab48ec2b668da6484690f4c

Checks will be approved automatically on success.

@hectorcast-db hectorcast-db added this pull request to the merge queue Apr 21, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 21, 2026
@hectorcast-db hectorcast-db added this pull request to the merge queue Apr 21, 2026
Merged via the queue into main with commit 9b3b11e Apr 21, 2026
16 checks passed
@hectorcast-db hectorcast-db deleted the hector/shares-ext-org-id-header branch April 21, 2026 12:11
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