Use TEST_ENVIRONMENT_TYPE for integration test filtering and deprecate is_account_client docstrings#1317
Merged
hectorcast-db merged 1 commit intomainfrom Mar 11, 2026
Conversation
a4a7ac4 to
d0effe5
Compare
d0effe5 to
1ecc86d
Compare
This was referenced Mar 10, 2026
1ecc86d to
5508849
Compare
…e is_account_client docstrings
5508849 to
0eff155
Compare
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
github-merge-queue bot
pushed a commit
to databricks/databricks-sdk-go
that referenced
this pull request
Mar 18, 2026
## 🥞 Stacked PR Use this [link](https://github.com/databricks/databricks-sdk-go/pull/1545/files) to review incremental changes. - [**stack/port/test-environment-type**](#1545) [[Files changed](https://github.com/databricks/databricks-sdk-go/pull/1545/files)] - [stack/port/host-metadata-integration-test](#1546) [[Files changed](https://github.com/databricks/databricks-sdk-go/pull/1546/files/c5bb35f157c24cbeb92396330626119a72cb2de7..996e3f148d614483fbd3302e8c5a75fbf2c32afc)] - [stack/port/remove-unified-flag](#1547) [[Files changed](https://github.com/databricks/databricks-sdk-go/pull/1547/files/996e3f148d614483fbd3302e8c5a75fbf2c32afc..5bfb6b121ee68f765a5ed4cb194f58372c9d7bf5)] - [stack/port/gcp-sa-from-metadata](#1548) [[Files changed](https://github.com/databricks/databricks-sdk-go/pull/1548/files/5bfb6b121ee68f765a5ed4cb194f58372c9d7bf5..6bfe5a46df8e98136ae1fa675158f5babc50ede4)] --------- ## Summary - Port of Python SDK PR databricks/databricks-sdk-py#1317 - Add `TEST_ENVIRONMENT_TYPE` environment variable support for integration test filtering - Supported values: `WORKSPACE`, `UC_WORKSPACE`, `ACCOUNT`, `UC_ACCOUNT` - Falls back to existing `DATABRICKS_ACCOUNT_ID`-based logic when not set ## Test plan - Integration test preludes updated; backward compatible with existing CI NO_CHANGELOG=true This pull request was AI-assisted by Isaac.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🥞 Stacked PR
Use this link to review incremental changes.
Summary
Replace
is_account_clientheuristics andDATABRICKS_ACCOUNT_IDpresence checks in integration test fixtures with explicitTEST_ENVIRONMENT_TYPE-based filtering. Also deprecateis_account_clientin docstrings acrossConfigandApiClient.Why
Integration test fixtures in
tests/integration/conftest.pyused two different heuristics to decide whether a test should run:account_client.config.is_account_client— inspects the host URL to infer whether the SDK is talking to an account-level API. This is unreliable now that unified hosts can serve both account and workspace APIs, and the property already raisesValueErrorwhenexperimental_is_unified_hostis set."DATABRICKS_ACCOUNT_ID" in os.environ— a proxy check used to skip workspace fixtures on account environments. This is fragile and doesn't express intent clearly.The test orchestrator now sets
TEST_ENVIRONMENT_TYPEexplicitly to one ofACCOUNT,UC_ACCOUNT,WORKSPACE, orUC_WORKSPACE. Using this value directly makes fixture skip-guards authoritative and easy to reason about.What changed
Interface changes
None. No public SDK API changes.
Behavioral changes
None for SDK users. Integration test fixture skip conditions are now driven by
TEST_ENVIRONMENT_TYPEinstead ofis_account_clientandDATABRICKS_ACCOUNT_ID.Internal changes
tests/integration/conftest.py: All four client fixtures (a,ucacct,w,ucws) now checkTEST_ENVIRONMENT_TYPEagainst an explicit allowlist instead of usingis_account_clientorDATABRICKS_ACCOUNT_ID.databricks/sdk/config.py: Updatedis_account_clientdocstring to note deprecation — clients can now support both workspace and account APIs from a single host.databricks/sdk/core.py: Added matching deprecation note toApiClient.is_account_client.How is this tested?
The changed code is test infrastructure itself. Correctness will be validated when integration tests run against environments that set
TEST_ENVIRONMENT_TYPE.NO_CHANGELOG=true