Merged
Conversation
* Introduce more specific exceptions, like `NotFound`, `AlreadyExists`, `BadRequest`, `PermissionDenied`, `InternalError`, and others ([#376](#376)). This makes it easier to handle errors thrown by the Databricks API. Instead of catching `DatabricksError` and checking the error_code field, you can catch one of these subtypes of `DatabricksError`, which is more ergonomic and removes the need to rethrow exceptions that you don't want to catch. For example: ```python try: return (self._ws .permissions .get(object_type, object_id)) except DatabricksError as e: if e.error_code in [ "RESOURCE_DOES_NOT_EXIST", "RESOURCE_NOT_FOUND", "PERMISSION_DENIED", "FEATURE_DISABLED", "BAD_REQUEST"]: logger.warning(...) return None raise RetryableError(...) from e ``` can be replaced with ```python try: return (self._ws .permissions .get(object_type, object_id)) except PermissionDenied, FeatureDisabled: logger.warning(...) return None except NotFound: raise RetryableError(...) ``` * Paginate all SCIM list requests in the SDK ([#440](#440)). This change ensures that SCIM list() APIs use a default limit of 100 resources, leveraging SCIM's offset + limit pagination to batch requests to the Databricks API. * Added taskValues support in remoteDbUtils ([#406](#406)). * Added more detailed error message on default credentials not found error ([#419](#419)). * Request management token via Azure CLI only for Service Principals and not human users ([#408](#408)). API Changes: * Fixed `create()` method for [w.functions](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/functions.html) workspace-level service and corresponding `databricks.sdk.service.catalog.CreateFunction` and `databricks.sdk.service.catalog.FunctionInfo` dataclasses. * Changed `create()` method for [w.metastores](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/metastores.html) workspace-level service with new required argument order. * Changed `storage_root` field for `databricks.sdk.service.catalog.CreateMetastore` to be optional. * Added `skip_validation` field for `databricks.sdk.service.catalog.UpdateExternalLocation`. * Added `libraries` field for `databricks.sdk.service.compute.CreatePolicy`, `databricks.sdk.service.compute.EditPolicy` and `databricks.sdk.service.compute.Policy`. * Added `init_scripts` field for `databricks.sdk.service.compute.EventDetails`. * Added `file` field for `databricks.sdk.service.compute.InitScriptInfo`. * Added `zone_id` field for `databricks.sdk.service.compute.InstancePoolGcpAttributes`. * Added several dataclasses related to init scripts. * Added `databricks.sdk.service.compute.LocalFileInfo` dataclass. * Replaced `ui_state` field with `edit_mode` for `databricks.sdk.service.jobs.CreateJob` and `databricks.sdk.service.jobs.JobSettings`. * Replaced `databricks.sdk.service.jobs.CreateJobUiState` dataclass with `databricks.sdk.service.jobs.CreateJobEditMode`. * Added `include_resolved_values` field for `databricks.sdk.service.jobs.GetRunRequest`. * Replaced `databricks.sdk.service.jobs.JobSettingsUiState` dataclass with `databricks.sdk.service.jobs.JobSettingsEditMode`. * Removed [a.o_auth_enrollment](https://databricks-sdk-py.readthedocs.io/en/latest/account/o_auth_enrollment.html) account-level service. This was only used to aid in OAuth enablement during the public preview of OAuth. OAuth is now enabled for all AWS E2 accounts, so usage of this API is no longer needed. * Added `network_connectivity_config_id` field for `databricks.sdk.service.provisioning.UpdateWorkspaceRequest`. * Added [a.network_connectivity](https://databricks-sdk-py.readthedocs.io/en/latest/account/network_connectivity.html) account-level service. * Added `string_shared_as` field for `databricks.sdk.service.sharing.SharedDataObject`. Internal changes: * Added regression question to issue template ([#414](#414)). * Made test_auth no longer fail if you have a default profile setup ([#426](#426)). OpenAPI SHA: d136ad0541f036372601bad9a4382db06c3c912d, Date: 2023-11-14
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #442 +/- ##
=======================================
Coverage 51.62% 51.62%
=======================================
Files 38 38
Lines 22266 22266
=======================================
Hits 11495 11495
Misses 10771 10771 ☔ View full report in Codecov by Sentry. |
tanmay-db
approved these changes
Nov 14, 2023
Contributor
Author
|
Integration tests have passed, so let's ship this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NotFound,AlreadyExists,BadRequest,PermissionDenied,InternalError, and others (#376). This makes it easier to handle errors thrown by the Databricks API. Instead of catchingDatabricksErrorand checking the error_code field, you can catch one of these subtypes ofDatabricksError, which is more ergonomic and removes the need to rethrow exceptions that you don't want to catch. For example:can be replaced with
API Changes:
create()method for w.functions workspace-level service and correspondingdatabricks.sdk.service.catalog.CreateFunctionanddatabricks.sdk.service.catalog.FunctionInfodataclasses.create()method for w.metastores workspace-level service with new required argument order.storage_rootfield fordatabricks.sdk.service.catalog.CreateMetastoreto be optional.skip_validationfield fordatabricks.sdk.service.catalog.UpdateExternalLocation.librariesfield fordatabricks.sdk.service.compute.CreatePolicy,databricks.sdk.service.compute.EditPolicyanddatabricks.sdk.service.compute.Policy.init_scriptsfield fordatabricks.sdk.service.compute.EventDetails.filefield fordatabricks.sdk.service.compute.InitScriptInfo.zone_idfield fordatabricks.sdk.service.compute.InstancePoolGcpAttributes.databricks.sdk.service.compute.LocalFileInfodataclass.ui_statefield withedit_modefordatabricks.sdk.service.jobs.CreateJobanddatabricks.sdk.service.jobs.JobSettings.databricks.sdk.service.jobs.CreateJobUiStatedataclass withdatabricks.sdk.service.jobs.CreateJobEditMode.include_resolved_valuesfield fordatabricks.sdk.service.jobs.GetRunRequest.databricks.sdk.service.jobs.JobSettingsUiStatedataclass withdatabricks.sdk.service.jobs.JobSettingsEditMode.network_connectivity_config_idfield fordatabricks.sdk.service.provisioning.UpdateWorkspaceRequest.string_shared_asfield fordatabricks.sdk.service.sharing.SharedDataObject.Internal changes:
OpenAPI SHA: d136ad0541f036372601bad9a4382db06c3c912d, Date: 2023-11-14