File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -837,7 +837,7 @@ class DatabricksConnectionConfig(ConnectionConfig):
837837 @property
838838 def shared_connection (self ) -> bool :
839839 """The connection should only be shared if U2M OAuth is being used"""
840- return self .auth_type is not None and self .oauth_client_id is None
840+ return self .auth_type is not None and self .oauth_client_secret is None
841841
842842 @model_validator (mode = "before" )
843843 def _databricks_connect_validator (cls , data : t .Any ) -> t .Any :
Original file line number Diff line number Diff line change @@ -1456,7 +1456,8 @@ def test_databricks__u2m_oauth__shared_connection_pool(make_config):
14561456 assert isinstance (adapter ._connection_pool , ThreadLocalSharedConnectionPool )
14571457
14581458
1459- def test_databricks__m2m_oauth__connection_pool (make_config ):
1459+ @patch .object (DatabricksConnectionConfig , "_connection_factory_with_kwargs" )
1460+ def test_databricks__m2m_oauth__connection_pool (mock_connection_factory_with_kwargs , make_config ):
14601461 from sqlmesh .utils .connection_pool import ThreadLocalConnectionPool
14611462
14621463 config = make_config (
@@ -1465,6 +1466,7 @@ def test_databricks__m2m_oauth__connection_pool(make_config):
14651466 http_path = "sql/test/foo" ,
14661467 auth_type = "databricks-oauth" ,
14671468 oauth_client_id = "oauth_client_id" ,
1469+ oauth_client_secret = "oauth_client_secret" ,
14681470 concurrent_tasks = 4 ,
14691471 )
14701472 assert isinstance (config , DatabricksConnectionConfig )
You can’t perform that action at this time.
0 commit comments