From d8b08bd923f239f3a7b5a937b354c4d76b4a9a3b Mon Sep 17 00:00:00 2001 From: Shubham Dhal Date: Wed, 24 Jun 2026 20:23:32 +0530 Subject: [PATCH] test: run parse-offline auth guards on all SDK versions The offline-parse guards were skipped on the min-deps floor (sdk 0.68.0) because the class was gated on the databricks-sdk>=0.103 host-metadata probe. That gate is wrong for non-PAT auth, where building Config does OIDC discovery (a network call on every SDK) -- the path #940 hit on 1.10.x. Drop the gate and its now-dead marker/import so the guards run on all SDK versions, including min-deps. --- tests/unit/test_auth.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/tests/unit/test_auth.py b/tests/unit/test_auth.py index 9b886739f..f32c2953f 100644 --- a/tests/unit/test_auth.py +++ b/tests/unit/test_auth.py @@ -5,21 +5,12 @@ import keyring.backend import pytest -from databricks.sdk import config as _sdk_config from dbt.adapters.databricks.credentials import ( DatabricksCredentialManager, DatabricksCredentials, ) -# databricks-sdk >=0.103 added a network probe to Config(); on older SDKs -# this symbol doesn't exist and the lazy `_ensure_config` path is unnecessary. -_REQUIRES_LAZY_CONFIG = pytest.mark.skipif( - not hasattr(_sdk_config, "get_host_metadata"), - reason="lazy _ensure_config is only required when Config() does a network probe", -) - - _COMMON_KWARGS = { "host": "yourorg.databricks.com", "database": "andre", @@ -28,7 +19,6 @@ } -@_REQUIRES_LAZY_CONFIG class TestParseTimeIsOffline: """`dbt parse/list/compile` must stay fully offline. Building `DatabricksCredentials` is on that path, so for every supported auth @@ -65,7 +55,6 @@ def test_azure_client_secret_credentials_init_does_not_call_config(self): mock_config.assert_not_called() -@_REQUIRES_LAZY_CONFIG class TestEnsureConfigTriggersTheRightAuth: """Connect-time counterpart to TestParseTimeIsOffline: when something actually does need the config (e.g. opening a connection), `_ensure_config`