Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions databricks/sdk/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions databricks/sdk/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
18 changes: 9 additions & 9 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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
Expand All @@ -96,19 +96,19 @@ 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()


@pytest.fixture(scope="session")
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()


Expand Down
Loading