@@ -60,10 +60,21 @@ def with_user_agent_extra(key: str, value: str):
60
60
class Config :
61
61
host : str = ConfigAttribute (env = "DATABRICKS_HOST" )
62
62
account_id : str = ConfigAttribute (env = "DATABRICKS_ACCOUNT_ID" )
63
+
64
+ # PAT token.
63
65
token : str = ConfigAttribute (env = "DATABRICKS_TOKEN" , auth = "pat" , sensitive = True )
66
+
67
+ # Audience for OIDC ID token source accepting an audience as a parameter.
68
+ # For example, the GitHub action ID token source.
64
69
token_audience : str = ConfigAttribute (env = "DATABRICKS_TOKEN_AUDIENCE" , auth = "github-oidc" )
70
+
71
+ # Environment variable for OIDC token.
72
+ oidc_token_env : str = ConfigAttribute (env = "DATABRICKS_OIDC_TOKEN_ENV" , auth = "env-oidc" )
73
+ oidc_token_filepath : str = ConfigAttribute (env = "DATABRICKS_OIDC_TOKEN_FILE" , auth = "file-oidc" )
74
+
65
75
username : str = ConfigAttribute (env = "DATABRICKS_USERNAME" , auth = "basic" )
66
76
password : str = ConfigAttribute (env = "DATABRICKS_PASSWORD" , auth = "basic" , sensitive = True )
77
+
67
78
client_id : str = ConfigAttribute (env = "DATABRICKS_CLIENT_ID" , auth = "oauth" )
68
79
client_secret : str = ConfigAttribute (env = "DATABRICKS_CLIENT_SECRET" , auth = "oauth" , sensitive = True )
69
80
profile : str = ConfigAttribute (env = "DATABRICKS_CONFIG_PROFILE" )
@@ -194,7 +205,7 @@ def oauth_token(self) -> Token:
194
205
def wrap_debug_info (self , message : str ) -> str :
195
206
debug_string = self .debug_string ()
196
207
if debug_string :
197
- message = f' { message .rstrip ("." )} . { debug_string } '
208
+ message = f" { message .rstrip ('.' )} . { debug_string } "
198
209
return message
199
210
200
211
@staticmethod
@@ -337,9 +348,9 @@ def debug_string(self) -> str:
337
348
safe = "***" if attr .sensitive else f"{ value } "
338
349
attrs_used .append (f"{ attr .name } ={ safe } " )
339
350
if attrs_used :
340
- buf .append (f' Config: { ", " .join (attrs_used )} ' )
351
+ buf .append (f" Config: { ', ' .join (attrs_used )} " )
341
352
if envs_used :
342
- buf .append (f' Env: { ", " .join (envs_used )} ' )
353
+ buf .append (f" Env: { ', ' .join (envs_used )} " )
343
354
return ". " .join (buf )
344
355
345
356
def to_dict (self ) -> Dict [str , any ]:
@@ -481,7 +492,7 @@ def _known_file_config_loader(self):
481
492
if profile not in profiles :
482
493
raise ValueError (f"resolve: { config_path } has no { profile } profile configured" )
483
494
raw_config = profiles [profile ]
484
- logger .info (f' loading { profile } profile from { config_file } : { ", " .join (raw_config .keys ())} ' )
495
+ logger .info (f" loading { profile } profile from { config_file } : { ', ' .join (raw_config .keys ())} " )
485
496
for k , v in raw_config .items ():
486
497
if k in self ._inner :
487
498
# don't overwrite a value previously set
0 commit comments