File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 11## dbt-databricks 1.9.6 (TBD)
22
3+ ### Fixes
4+
5+ - Fix for parse raising error for not having credentials ([941](https://github.com/databricks/dbt-databricks/pull/941))
6+
37### Under the Hood
48
59- Refactoring of some connection internals ([929](https://github.com/databricks/dbt-databricks/pull/929))
Original file line number Diff line number Diff line change @@ -202,12 +202,19 @@ class DatabricksConnectionManager(SparkConnectionManager):
202202
203203 def __init__ (self , profile : AdapterRequiredConfig , mp_context : SpawnContext ):
204204 super ().__init__ (profile , mp_context )
205- creds = cast (DatabricksCredentials , self .profile .credentials )
206- self .api_client = DatabricksApiClient .create (creds , 15 * 60 )
205+ self ._api_client : Optional [DatabricksApiClient ] = None
207206 self .threads_compute_connections : dict [
208207 Hashable , dict [Hashable , DatabricksDBTConnection ]
209208 ] = {}
210209
210+ @property
211+ def api_client (self ) -> DatabricksApiClient :
212+ if self ._api_client is None :
213+ self ._api_client = DatabricksApiClient .create (
214+ cast (DatabricksCredentials , self .profile .credentials ), 15 * 60
215+ )
216+ return self ._api_client
217+
211218 def cancel_open (self ) -> list [str ]:
212219 cancelled = super ().cancel_open ()
213220 logger .info ("Cancelling open python jobs" )
You can’t perform that action at this time.
0 commit comments