Skip to content

Commit

Permalink
Merge branch 'main' into change-upload-arg-to-union
Browse files Browse the repository at this point in the history
  • Loading branch information
cornzyblack authored Jan 28, 2024
2 parents 677c820 + 851be2b commit 3625736
Show file tree
Hide file tree
Showing 191 changed files with 24,008 additions and 1,457 deletions.
5 changes: 3 additions & 2 deletions .codegen/__init__.py.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import databricks.sdk.core as client
import databricks.sdk.dbutils as dbutils
from databricks.sdk.credentials_provider import CredentialsProvider

from databricks.sdk.mixins.files import DbfsExt
from databricks.sdk.mixins.compute import ClustersExt
Expand Down Expand Up @@ -43,7 +44,7 @@ class WorkspaceClient:
debug_headers: bool = None,
product="unknown",
product_version="0.0.0",
credentials_provider: client.CredentialsProvider = None,
credentials_provider: CredentialsProvider = None,
config: client.Config = None):
if not config:
config = client.Config({{range $args}}{{.}}={{.}}, {{end}}
Expand Down Expand Up @@ -91,7 +92,7 @@ class AccountClient:
debug_headers: bool = None,
product="unknown",
product_version="0.0.0",
credentials_provider: client.CredentialsProvider = None,
credentials_provider: CredentialsProvider = None,
config: client.Config = None):
if not config:
config = client.Config({{range $args}}{{.}}={{.}}, {{end}}
Expand Down
2 changes: 1 addition & 1 deletion .codegen/_openapi_sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d3853c8dee5806d04da2ae8910f273ffb35719a5
e05401ed5dd4974c5333d737ec308a7d451f749f
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ databricks/sdk/errors/mapping.py linguist-generated=true
databricks/sdk/service/billing.py linguist-generated=true
databricks/sdk/service/catalog.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
databricks/sdk/service/iam.py linguist-generated=true
databricks/sdk/service/jobs.py linguist-generated=true
Expand All @@ -14,6 +15,7 @@ databricks/sdk/service/serving.py linguist-generated=true
databricks/sdk/service/settings.py linguist-generated=true
databricks/sdk/service/sharing.py linguist-generated=true
databricks/sdk/service/sql.py linguist-generated=true
databricks/sdk/service/vectorsearch.py linguist-generated=true
databricks/sdk/service/workspace.py linguist-generated=true
examples/alerts/create_alerts.py linguist-generated=true
examples/alerts/get_alerts.py linguist-generated=true
Expand Down
71 changes: 71 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,76 @@
# Version changelog

## 0.18.0

Bugfixes:

* Fix Databricks OAuth M2M on Azure ([#513](https://github.com/databricks/databricks-sdk-py/pull/513)).

Other noteworthy changes:

* Use `[]` instead of `None` as default list value for deserialising responses ([#361](https://github.com/databricks/databricks-sdk-py/pull/361)).
* Support dev and staging workspaces ([#514](https://github.com/databricks/databricks-sdk-py/pull/514)).

API Changes:

* Added `exists()` method for [w.tables](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/tables.html) workspace-level service.
* Added [w.lakehouse_monitors](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/lakehouse_monitors.html) workspace-level service.
* Added the following dataclasses:
`databricks.sdk.service.catalog.CreateMonitor`,
`databricks.sdk.service.catalog.DeleteLakehouseMonitorRequest`,
`databricks.sdk.service.catalog.ExistsRequest`,
`databricks.sdk.service.catalog.GetLakehouseMonitorRequest`,
`databricks.sdk.service.catalog.MonitorCronSchedule`,
`databricks.sdk.service.catalog.MonitorCronSchedulePauseStatus`,
`databricks.sdk.service.catalog.MonitorCustomMetric`,
`databricks.sdk.service.catalog.MonitorCustomMetricType`,
`databricks.sdk.service.catalog.MonitorDataClassificationConfig`,
`databricks.sdk.service.catalog.MonitorDestinations`,
`databricks.sdk.service.catalog.MonitorInferenceLogProfileType`,
`databricks.sdk.service.catalog.MonitorInferenceLogProfileTypeProblemType`,
`databricks.sdk.service.catalog.MonitorInfo`,
`databricks.sdk.service.catalog.MonitorInfoStatus`,
`databricks.sdk.service.catalog.MonitorNotificationsConfig`,
`databricks.sdk.service.catalog.MonitorTimeSeriesProfileType`,
`databricks.sdk.service.catalog.TableExistsResponse` and
`databricks.sdk.service.catalog.UpdateMonitor`.
* Changed `create_obo_token()` method for [w.token_management](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/token_management.html) workspace-level service with new required argument order.
* Changed `get()` method for [w.token_management](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/token_management.html) workspace-level service to return `databricks.sdk.service.settings.GetTokenResponse` dataclass.
* Changed `lifetime_seconds` field for `databricks.sdk.service.settings.CreateOboTokenRequest` to no longer be required.
* Added `databricks.sdk.service.settings.GetTokenResponse` dataclass.

OpenAPI SHA: e05401ed5dd4974c5333d737ec308a7d451f749f, Date: 2024-01-23

## 0.17.0

* Use covariant type for `@retried(on=[...])` ([#486](https://github.com/databricks/databricks-sdk-py/pull/486)).
* Configure request timeout using existing parameter from Config ([#489](https://github.com/databricks/databricks-sdk-py/pull/489)).
* Make contents of `__init__.py` equal across projects ([#488](https://github.com/databricks/databricks-sdk-py/pull/488)).
* Update SDK to Latest OpenAPI Specification ([#501](https://github.com/databricks/databricks-sdk-py/pull/501)).

Note: This release contains breaking changes, please see below for more details.

API Changes:

* [Breaking] Changed `list()` method for [w.tokens](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/tokens.html) workspace-level service to return `databricks.sdk.service.settings.ListPublicTokensResponse` dataclass.
* Changed `list()` method for [w.external_locations](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/external_locations.html) workspace-level service to require request of `databricks.sdk.service.catalog.ListExternalLocationsRequest` dataclass and [w.storage_credentials](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/storage_credentials.html) workspace-level service to require request of `databricks.sdk.service.catalog.ListStorageCredentialsRequest` dataclass.
* Added `next_page_token` field for `databricks.sdk.service.catalog.ListExternalLocationsResponse`, `databricks.sdk.service.catalog.ListFunctionsResponse`, `databricks.sdk.service.catalog.ListSchemasResponse` and `databricks.sdk.service.catalog.ListStorageCredentialsResponse`.
* Added `max_results` field for `databricks.sdk.service.catalog.ListFunctionsRequest` and `databricks.sdk.service.catalog.ListSchemasRequest`.
* Added `page_token` field for `databricks.sdk.service.catalog.ListFunctionsRequest` and `databricks.sdk.service.catalog.ListSchemasRequest`.
* Added `omit_columns` field for `databricks.sdk.service.catalog.ListTablesRequest`.
* Added `omit_properties` field for `databricks.sdk.service.catalog.ListTablesRequest`.
* Added `init_scripts` field for `databricks.sdk.service.pipelines.PipelineCluster`.
* Added `validate_only` field for `databricks.sdk.service.pipelines.StartUpdate` and `databricks.sdk.service.pipelines.UpdateInfo`.
* Changed `create()` method for [w.dashboards](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/dashboards.html) workspace-level service . New request type is `databricks.sdk.service.sql.DashboardPostContent` dataclass.
* Added `update()` method for [w.dashboards](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/dashboards.html) workspace-level service.
* Added `http_headers` field for `databricks.sdk.service.sql.ExternalLink`.
* Added `run_as_role` field for `databricks.sdk.service.sql.QueryEditContent`.
* Added package: `databricks.sdk.service.dashboards` and `databricks.sdk.service.vectorsearch`.
* Added dataclass: `databricks.sdk.service.catalog.ListExternalLocationsRequest`, `databricks.sdk.service.catalog.ListStorageCredentialsRequest`, `databricks.sdk.service.settings.ListPublicTokensResponse`, `databricks.sdk.service.sql.DashboardEditContent` and `databricks.sdk.service.sql.DashboardPostContent`.
* Removed dataclass: `databricks.sdk.service.catalog.TableConstraintList` and `databricks.sdk.service.sql.CreateDashboardRequest`.

OpenAPI SHA: 0e0d4cbe87193e36c73b8b2be3b0dd0f1b013e00, Date: 2024-01-10

## 0.16.0

* Sort imports in service template ([#479](https://github.com/databricks/databricks-sdk-py/pull/479)).
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ The Databricks SDK for Python picks up an Azure CLI token, if you've previously

To authenticate as an Azure Active Directory (Azure AD) service principal, you must provide one of the following. See also [Add a service principal to your Azure Databricks account](https://learn.microsoft.com/azure/databricks/administration-guide/users-groups/service-principals#add-sp-account):

- `azure_resource_id`, `azure_client_secret`, `azure_client_id`, and `azure_tenant_id`; or their environment variable or `.databrickscfg` file field equivalents.
- `azure_resource_id` and `azure_use_msi`; or their environment variable or `.databrickscfg` file field equivalents.
- `azure_workspace_resource_id`, `azure_client_secret`, `azure_client_id`, and `azure_tenant_id`; or their environment variable or `.databrickscfg` file field equivalents.
- `azure_workspace_resource_id` and `azure_use_msi`; or their environment variable or `.databrickscfg` file field equivalents.

| Argument | Description | Environment variable |
|-----------------------|-------------|----------------------|
| `azure_resource_id` | _(String)_ The Azure Resource Manager ID for the Azure Databricks workspace, which is exchanged for a Databricks host URL. | `DATABRICKS_AZURE_RESOURCE_ID` |
| `azure_workspace_resource_id` | _(String)_ The Azure Resource Manager ID for the Azure Databricks workspace, which is exchanged for a Databricks host URL. | `DATABRICKS_AZURE_RESOURCE_ID` |
| `azure_use_msi` | _(Boolean)_ `true` to use Azure Managed Service Identity passwordless authentication flow for service principals. _This feature is not yet implemented in the Databricks SDK for Python._ | `ARM_USE_MSI` |
| `azure_client_secret` | _(String)_ The Azure AD service principal's client secret. | `ARM_CLIENT_SECRET` |
| `azure_client_id` | _(String)_ The Azure AD service principal's application ID. | `ARM_CLIENT_ID` |
Expand Down
36 changes: 32 additions & 4 deletions databricks/sdk/__init__.py

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

10 changes: 3 additions & 7 deletions databricks/sdk/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,15 @@ class AzureEnvironment:
ARM_DATABRICKS_RESOURCE_ID = "2ff814a6-3304-4ab8-85cb-cd0e6f879c1d"

ENVIRONMENTS = dict(
PUBLIC=AzureEnvironment(name="AzurePublicCloud",
PUBLIC=AzureEnvironment(name="PUBLIC",
service_management_endpoint="https://management.core.windows.net/",
resource_manager_endpoint="https://management.azure.com/",
active_directory_endpoint="https://login.microsoftonline.com/"),
GERMAN=AzureEnvironment(name="AzureGermanCloud",
service_management_endpoint="https://management.core.cloudapi.de/",
resource_manager_endpoint="https://management.microsoftazure.de/",
active_directory_endpoint="https://login.microsoftonline.de/"),
USGOVERNMENT=AzureEnvironment(name="AzureUSGovernmentCloud",
USGOVERNMENT=AzureEnvironment(name="USGOVERNMENT",
service_management_endpoint="https://management.core.usgovcloudapi.net/",
resource_manager_endpoint="https://management.usgovcloudapi.net/",
active_directory_endpoint="https://login.microsoftonline.us/"),
CHINA=AzureEnvironment(name="AzureChinaCloud",
CHINA=AzureEnvironment(name="CHINA",
service_management_endpoint="https://management.core.chinacloudapi.cn/",
resource_manager_endpoint="https://management.chinacloudapi.cn/",
active_directory_endpoint="https://login.chinacloudapi.cn/"),
Expand Down
Loading

0 comments on commit 3625736

Please sign in to comment.