Skip to content

Commit 6ab1355

Browse files
Enable support for a single Profile to use both Account and Workspace endpoints (#1232)
## What changes are proposed in this pull request? Enable support for a single Profile to use both Account and Workspace endpoints. This is done by moving the header injection logic to the code generation, which is aware of which endpoints are workspace specific. ## How is this tested? Updated test. --------- Signed-off-by: hectorcast-db <hector.castejon@databricks.com>
1 parent f79910f commit 6ab1355

37 files changed

Lines changed: 4099 additions & 14 deletions

NEXT_CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Release v0.83.0
44

55
### New Features and Improvements
6+
* Add support for single Profile for Account and Workspace operations in Unified Mode.
67

78
### Security
89

databricks/sdk/core.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,11 @@ class ApiClient:
2323
def __init__(self, cfg: Config):
2424
self._cfg = cfg
2525

26-
# Create header factory that includes both auth and org ID headers
27-
def combined_header_factory():
28-
headers = cfg.authenticate()
29-
# Add X-Databricks-Org-Id header for workspace clients on unified hosts
30-
if cfg.workspace_id and cfg.host_type == HostType.UNIFIED:
31-
headers["X-Databricks-Org-Id"] = cfg.workspace_id
32-
return headers
33-
3426
self._api_client = _BaseClient(
3527
debug_truncate_bytes=cfg.debug_truncate_bytes,
3628
retry_timeout_seconds=cfg.retry_timeout_seconds,
3729
user_agent_base=cfg.user_agent,
38-
header_factory=combined_header_factory,
30+
header_factory=cfg.authenticate,
3931
max_connection_pools=cfg.max_connection_pools,
4032
max_connections_per_pool=cfg.max_connections_per_pool,
4133
pool_block=True,

databricks/sdk/service/agentbricks.py

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

databricks/sdk/service/apps.py

Lines changed: 85 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)