diff --git a/databricks/sdk/config.py b/databricks/sdk/config.py index 0d7001bd1..9be529081 100644 --- a/databricks/sdk/config.py +++ b/databricks/sdk/config.py @@ -440,9 +440,8 @@ def client_type(self) -> ClientType: @property def is_account_client(self) -> bool: - """[Deprecated] Use host_type or client_type instead. - - Determines if this is an account client based on the host URL. + """[Deprecated] + Host type and client type are deprecated. Clients can now support both workspace and account APIs. """ if self.experimental_is_unified_host: raise ValueError( diff --git a/databricks/sdk/core.py b/databricks/sdk/core.py index 9d6c83703..b8590758e 100644 --- a/databricks/sdk/core.py +++ b/databricks/sdk/core.py @@ -42,6 +42,7 @@ def account_id(self) -> str: @property def is_account_client(self) -> bool: + """[Deprecated] Host type and client type are deprecated. Clients can now support both workspace and account APIs.""" return self._cfg.is_account_client def get_oauth_token(self, auth_details: str) -> Token: diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index bb71a5f7b..ba69cfd9f 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -65,8 +65,8 @@ def a(env_or_skip) -> AccountClient: _load_debug_env_if_runs_from_ide("account") env_or_skip("CLOUD_ENV") account_client = AccountClient() - if not account_client.config.is_account_client: - pytest.skip("not Databricks Account client") + if env_or_skip("TEST_ENVIRONMENT_TYPE") not in ["ACCOUNT", "UC_ACCOUNT"]: + pytest.skip("not Databricks Account environment") return account_client @@ -75,8 +75,8 @@ def ucacct(env_or_skip) -> AccountClient: _load_debug_env_if_runs_from_ide("ucacct") env_or_skip("CLOUD_ENV") account_client = AccountClient() - if not account_client.config.is_account_client: - pytest.skip("not Databricks Account client") + if env_or_skip("TEST_ENVIRONMENT_TYPE") not in ["UC_ACCOUNT"]: + pytest.skip("not Databricks UC Account environment") if "TEST_METASTORE_ID" not in os.environ: pytest.skip("not in Unity Catalog Workspace test env") return account_client @@ -96,8 +96,8 @@ def unified_config(env_or_skip) -> Config: def w(env_or_skip) -> WorkspaceClient: _load_debug_env_if_runs_from_ide("workspace") env_or_skip("CLOUD_ENV") - if "DATABRICKS_ACCOUNT_ID" in os.environ: - pytest.skip("Skipping workspace test on account level") + if env_or_skip("TEST_ENVIRONMENT_TYPE") not in ["WORKSPACE", "UC_WORKSPACE"]: + pytest.skip("not Databricks Workspace environment") return WorkspaceClient() @@ -105,10 +105,10 @@ def w(env_or_skip) -> WorkspaceClient: def ucws(env_or_skip) -> WorkspaceClient: _load_debug_env_if_runs_from_ide("ucws") env_or_skip("CLOUD_ENV") - if "DATABRICKS_ACCOUNT_ID" in os.environ: - pytest.skip("Skipping workspace test on account level") + if env_or_skip("TEST_ENVIRONMENT_TYPE") not in ["UC_WORKSPACE"]: + pytest.skip("not Databricks UC Workspace environment") if "TEST_METASTORE_ID" not in os.environ: - pytest.skip("not in Unity Catalog Workspace test env") + pytest.skip("not Databricks UC Workspace environment") return WorkspaceClient()