Skip to content

Commit

Permalink
[Internal] Update SDK to OpenAPI spec
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmay-db committed Dec 6, 2024
1 parent 9801660 commit 0ef38e0
Show file tree
Hide file tree
Showing 48 changed files with 14,691 additions and 179 deletions.
2 changes: 1 addition & 1 deletion .codegen/_openapi_sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f2385add116e3716c8a90a0b68e204deb40f996c
7016dcbf2e011459416cf408ce21143bcc4b3a25
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ databricks/sdk/errors/platform.py linguist-generated=true
databricks/sdk/service/apps.py linguist-generated=true
databricks/sdk/service/billing.py linguist-generated=true
databricks/sdk/service/catalog.py linguist-generated=true
databricks/sdk/service/cleanrooms.py linguist-generated=true
databricks/sdk/service/compute.py linguist-generated=true
databricks/sdk/service/dashboards.py linguist-generated=true
databricks/sdk/service/files.py linguist-generated=true
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.envFile": "${workspaceFolder}/.databricks/.databricks.env",
"python.envFile": "${workspaceRoot}/.env",
"databricks.python.envFile": "${workspaceFolder}/.env",
"jupyter.interactiveWindow.cellMarker.codeRegex": "^# COMMAND ----------|^# Databricks notebook source|^(#\\s*%%|#\\s*\\<codecell\\>|#\\s*In\\[\\d*?\\]|#\\s*In\\[ \\])",
"jupyter.interactiveWindow.cellMarker.default": "# COMMAND ----------"
Expand Down
21 changes: 21 additions & 0 deletions databricks/sdk/__init__.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 9 additions & 10 deletions databricks/sdk/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,15 @@ class Config:
max_connections_per_pool: int = ConfigAttribute()
databricks_environment: Optional[DatabricksEnvironment] = None

def __init__(
self,
*,
# Deprecated. Use credentials_strategy instead.
credentials_provider: Optional[CredentialsStrategy] = None,
credentials_strategy: Optional[CredentialsStrategy] = None,
product=None,
product_version=None,
clock: Optional[Clock] = None,
**kwargs):
def __init__(self,
*,
# Deprecated. Use credentials_strategy instead.
credentials_provider: Optional[CredentialsStrategy] = None,
credentials_strategy: Optional[CredentialsStrategy] = None,
product=None,
product_version=None,
clock: Optional[Clock] = None,
**kwargs):
self._header_factory = None
self._inner = {}
self._user_agent_other_info = []
Expand Down
11 changes: 5 additions & 6 deletions databricks/sdk/credentials_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,11 @@ def github_oidc_azure(cfg: 'Config') -> Optional[CredentialsProvider]:
# detect Azure AD Tenant ID if it's not specified directly
token_endpoint = cfg.oidc_endpoints.token_endpoint
cfg.azure_tenant_id = token_endpoint.replace(aad_endpoint, '').split('/')[0]
inner = ClientCredentials(
client_id=cfg.azure_client_id,
client_secret="", # we have no (rotatable) secrets in OIDC flow
token_url=f"{aad_endpoint}{cfg.azure_tenant_id}/oauth2/token",
endpoint_params=params,
use_params=True)
inner = ClientCredentials(client_id=cfg.azure_client_id,
client_secret="", # we have no (rotatable) secrets in OIDC flow
token_url=f"{aad_endpoint}{cfg.azure_tenant_id}/oauth2/token",
endpoint_params=params,
use_params=True)

def refreshed_headers() -> Dict[str, str]:
token = inner.token()
Expand Down
Loading

0 comments on commit 0ef38e0

Please sign in to comment.