-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce more specific exceptions, like NotFound
, AlreadyExists
, BadRequest
, PermissionDenied
, InternalError
, and others
#185
Conversation
… `BadRequest`, `PermissionDenied`, `InternalError`, and others See implementations in other SDKs: - Go: databricks/databricks-sdk-go#682 - Python: databricks/databricks-sdk-py#376
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Largely looks good to me, but I think there are a couple issues with ordering in ErrorMapper and with error codes being dropped for status code-based errors.
.codegen/exception.java.tmpl
Outdated
{{if not .Inherit}} | ||
{{.PascalName}}(String errorCode, String message, int statusCode, List<ErrorDetail> details) { | ||
super(errorCode, message, statusCode, details); | ||
} | ||
{{end}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This case isn't used yet, but I suspect you may want to use it if you follow my comments in AbstractErrorMapper.java.
if (statusCodeMapping.containsKey(code)) { | ||
return statusCodeMapping.get(code).create(message, details); | ||
} | ||
if (errorCodeMapping.containsKey(errorCode)) { | ||
return errorCodeMapping.get(errorCode).create(message, details); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is in the wrong order: we should check for specific error code first and then fall back to status code.
String errorCode = errorBody.getErrorCode(); | ||
List<ErrorDetail> details = errorBody.getErrorDetails(); | ||
if (statusCodeMapping.containsKey(code)) { | ||
return statusCodeMapping.get(code).create(message, details); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could cause some confusing behavior for old clients when new error codes are introduced. The error code provided in the API response is not explicitly propagated to these exception types. I think you might need two "rule" interfaces: one for ErrorCode-based exceptions (with well-known error codes, so only need parameters for message and details) and one for StatusCode-based exceptions (with dynamic error-codes, so you need an extra parameter for the error code).
Merge queue setting changed
|
||
@Test | ||
void clusterDoesNotExist(WorkspaceClient w) { | ||
assertThrowsExactly( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test will fail once I merge the follow-up change (equivalent of databricks/databricks-sdk-py@45a356c)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted, cc: @edwardfeng-db as current oncall (nightly would fail but it's expected).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack, thanks. But do we expect a fix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will fix it in that PR, no worries.l
…ava into errors/typed
if (errorCodeMapping.containsKey(errorCode)) { | ||
return errorCodeMapping.get(errorCode).create(message, details); | ||
} | ||
if (statusCodeMapping.containsKey(code)) { | ||
return statusCodeMapping.get(code).create(errorCode, message, details); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should store them and return at the end because in future we might need to use both statusCodeMapping and errorCodeMapping, with early return we give precedence to errorCodeMapping.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error codes always take precedence over status codes. The same status code could be used to represent different error codes. Because of this, we don't need to store status code there.
|
||
@Test | ||
void clusterDoesNotExist(WorkspaceClient w) { | ||
assertThrowsExactly( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted, cc: @edwardfeng-db as current oncall (nightly would fail but it's expected).
### Improvements and Bug Fixes * Introduce more specific exceptions, like `NotFound`, `AlreadyExists`, `BadRequest`, `PermissionDenied`, `InternalError`, and others ([#185](#185), [#257](#257)). * Lock around field accessibility changes ([#247](#247)). * Fix Changelog ([#258](#258)). * Support post with no body for APIs ([#262](#262)). API Changes: * Changed `cancelRefresh()` method for `workspaceClient.lakehouseMonitors()` service with new required argument order. * Changed `create()` method for `workspaceClient.lakehouseMonitors()` service with new required argument order. * Changed `delete()` method for `workspaceClient.lakehouseMonitors()` service with new required argument order. * Changed `get()` method for `workspaceClient.lakehouseMonitors()` service with new required argument order. * Changed `getRefresh()` method for `workspaceClient.lakehouseMonitors()` service with new required argument order. * Changed `listRefreshes()` method for `workspaceClient.lakehouseMonitors()` service with new required argument order. * Changed `runRefresh()` method for `workspaceClient.lakehouseMonitors()` service with new required argument order. * Changed `update()` method for `workspaceClient.lakehouseMonitors()` service with new required argument order. * Removed `com.databricks.sdk.service.catalog.AzureManagedIdentity` class. * Removed `fullName` field for `com.databricks.sdk.service.catalog.CancelRefreshRequest`. * Added `tableName` field for `com.databricks.sdk.service.catalog.CancelRefreshRequest`. * Changed `customMetrics` field for `com.databricks.sdk.service.catalog.CreateMonitor` to `com.databricks.sdk.service.catalog.MonitorMetricList` class. * Removed `fullName` field for `com.databricks.sdk.service.catalog.CreateMonitor`. * Changed `inferenceLog` field for `com.databricks.sdk.service.catalog.CreateMonitor` to `com.databricks.sdk.service.catalog.MonitorInferenceLog` class. * Changed `notifications` field for `com.databricks.sdk.service.catalog.CreateMonitor` to `com.databricks.sdk.service.catalog.MonitorNotifications` class. * Changed `snapshot` field for `com.databricks.sdk.service.catalog.CreateMonitor` to `Object` class. * Changed `timeSeries` field for `com.databricks.sdk.service.catalog.CreateMonitor` to `com.databricks.sdk.service.catalog.MonitorTimeSeries` class. * Added `tableName` field for `com.databricks.sdk.service.catalog.CreateMonitor`. * Changed `azureManagedIdentity` field for `com.databricks.sdk.service.catalog.CreateStorageCredential` to `com.databricks.sdk.service.catalog.AzureManagedIdentityRequest` class. * Removed `fullName` field for `com.databricks.sdk.service.catalog.DeleteLakehouseMonitorRequest`. * Added `tableName` field for `com.databricks.sdk.service.catalog.DeleteLakehouseMonitorRequest`. * Removed `fullName` field for `com.databricks.sdk.service.catalog.GetLakehouseMonitorRequest`. * Added `tableName` field for `com.databricks.sdk.service.catalog.GetLakehouseMonitorRequest`. * Removed `fullName` field for `com.databricks.sdk.service.catalog.GetRefreshRequest`. * Added `tableName` field for `com.databricks.sdk.service.catalog.GetRefreshRequest`. * Removed `fullName` field for `com.databricks.sdk.service.catalog.ListRefreshesRequest`. * Added `tableName` field for `com.databricks.sdk.service.catalog.ListRefreshesRequest`. * Changed `quartzCronExpression` field for `com.databricks.sdk.service.catalog.MonitorCronSchedule` to be required. * Changed `timezoneId` field for `com.databricks.sdk.service.catalog.MonitorCronSchedule` to be required. * Removed `com.databricks.sdk.service.catalog.MonitorCustomMetric` class. * Removed `com.databricks.sdk.service.catalog.MonitorCustomMetricType` class. * Removed `com.databricks.sdk.service.catalog.MonitorDestinations` class. * Removed `com.databricks.sdk.service.catalog.MonitorInferenceLogProfileType` class. * Removed `com.databricks.sdk.service.catalog.MonitorInferenceLogProfileTypeProblemType` class. * Changed `customMetrics` field for `com.databricks.sdk.service.catalog.MonitorInfo` to `com.databricks.sdk.service.catalog.MonitorMetricList` class. * Changed `driftMetricsTableName` field for `com.databricks.sdk.service.catalog.MonitorInfo` to be required. * Changed `inferenceLog` field for `com.databricks.sdk.service.catalog.MonitorInfo` to `com.databricks.sdk.service.catalog.MonitorInferenceLog` class. * Changed `monitorVersion` field for `com.databricks.sdk.service.catalog.MonitorInfo` to be required. * Changed `notifications` field for `com.databricks.sdk.service.catalog.MonitorInfo` to `com.databricks.sdk.service.catalog.MonitorNotifications` class. * Changed `profileMetricsTableName` field for `com.databricks.sdk.service.catalog.MonitorInfo` to be required. * Changed `snapshot` field for `com.databricks.sdk.service.catalog.MonitorInfo` to `Object` class. * Changed `status` field for `com.databricks.sdk.service.catalog.MonitorInfo` to be required. * Changed `tableName` field for `com.databricks.sdk.service.catalog.MonitorInfo` to be required. * Changed `timeSeries` field for `com.databricks.sdk.service.catalog.MonitorInfo` to `com.databricks.sdk.service.catalog.MonitorTimeSeries` class. * Removed `com.databricks.sdk.service.catalog.MonitorNotificationsConfig` class. * Changed `refreshId` field for `com.databricks.sdk.service.catalog.MonitorRefreshInfo` to be required. * Changed `startTimeMs` field for `com.databricks.sdk.service.catalog.MonitorRefreshInfo` to be required. * Changed `state` field for `com.databricks.sdk.service.catalog.MonitorRefreshInfo` to be required. * Added `trigger` field for `com.databricks.sdk.service.catalog.MonitorRefreshInfo`. * Removed `Object` class. * Removed `com.databricks.sdk.service.catalog.MonitorTimeSeriesProfileType` class. * Removed `fullName` field for `com.databricks.sdk.service.catalog.RunRefreshRequest`. * Added `tableName` field for `com.databricks.sdk.service.catalog.RunRefreshRequest`. * Changed `azureManagedIdentity` field for `com.databricks.sdk.service.catalog.StorageCredentialInfo` to `com.databricks.sdk.service.catalog.AzureManagedIdentityResponse` class. * Removed `name` field for `com.databricks.sdk.service.catalog.TableRowFilter`. * Added `functionName` field for `com.databricks.sdk.service.catalog.TableRowFilter`. * Changed `customMetrics` field for `com.databricks.sdk.service.catalog.UpdateMonitor` to `com.databricks.sdk.service.catalog.MonitorMetricList` class. * Removed `fullName` field for `com.databricks.sdk.service.catalog.UpdateMonitor`. * Changed `inferenceLog` field for `com.databricks.sdk.service.catalog.UpdateMonitor` to `com.databricks.sdk.service.catalog.MonitorInferenceLog` class. * Changed `notifications` field for `com.databricks.sdk.service.catalog.UpdateMonitor` to `com.databricks.sdk.service.catalog.MonitorNotifications` class. * Changed `snapshot` field for `com.databricks.sdk.service.catalog.UpdateMonitor` to `Object` class. * Changed `timeSeries` field for `com.databricks.sdk.service.catalog.UpdateMonitor` to `com.databricks.sdk.service.catalog.MonitorTimeSeries` class. * Added `tableName` field for `com.databricks.sdk.service.catalog.UpdateMonitor`. * Changed `azureManagedIdentity` field for `com.databricks.sdk.service.catalog.UpdateStorageCredential` to `com.databricks.sdk.service.catalog.AzureManagedIdentityResponse` class. * Changed `azureManagedIdentity` field for `com.databricks.sdk.service.catalog.ValidateStorageCredential` to `com.databricks.sdk.service.catalog.AzureManagedIdentityRequest` class. * Removed `operation` field for `com.databricks.sdk.service.catalog.ValidationResult`. * Added `awsOperation` field for `com.databricks.sdk.service.catalog.ValidationResult`. * Added `azureOperation` field for `com.databricks.sdk.service.catalog.ValidationResult`. * Added `gcpOperation` field for `com.databricks.sdk.service.catalog.ValidationResult`. * Removed `com.databricks.sdk.service.catalog.ValidationResultOperation` class. * Added `com.databricks.sdk.service.catalog.AzureManagedIdentityRequest` class. * Added `com.databricks.sdk.service.catalog.AzureManagedIdentityResponse` class. * Added `com.databricks.sdk.service.catalog.MonitorDestination` class. * Added `com.databricks.sdk.service.catalog.MonitorInferenceLog` class. * Added `com.databricks.sdk.service.catalog.MonitorInferenceLogProblemType` class. * Added `com.databricks.sdk.service.catalog.MonitorMetric` class. * Added `com.databricks.sdk.service.catalog.MonitorMetricType` class. * Added `com.databricks.sdk.service.catalog.MonitorNotifications` class. * Added `com.databricks.sdk.service.catalog.MonitorRefreshInfoTrigger` class. * Added `Object` class. * Added `com.databricks.sdk.service.catalog.MonitorTimeSeries` class. * Added `com.databricks.sdk.service.catalog.ValidationResultAwsOperation` class. * Added `com.databricks.sdk.service.catalog.ValidationResultAzureOperation` class. * Added `com.databricks.sdk.service.catalog.ValidationResultGcpOperation` class. * Added `cloneFrom` field for `com.databricks.sdk.service.compute.ClusterSpec`. * Removed `com.databricks.sdk.service.compute.ComputeSpec` class. * Removed `com.databricks.sdk.service.compute.ComputeSpecKind` class. * Added `cloneFrom` field for `com.databricks.sdk.service.compute.CreateCluster`. * Added `cloneFrom` field for `com.databricks.sdk.service.compute.EditCluster`. * Added `com.databricks.sdk.service.compute.CloneCluster` class. * Added `com.databricks.sdk.service.compute.Environment` class. * Changed `update()` method for `accountClient.workspaceAssignment()` service to return `com.databricks.sdk.service.iam.PermissionAssignment` class. * Removed `Object` class. * Removed `computeKey` field for `com.databricks.sdk.service.jobs.ClusterSpec`. * Removed `compute` field for `com.databricks.sdk.service.jobs.CreateJob`. * Added `environments` field for `com.databricks.sdk.service.jobs.CreateJob`. * Removed `com.databricks.sdk.service.jobs.JobCompute` class. * Removed `compute` field for `com.databricks.sdk.service.jobs.JobSettings`. * Added `environments` field for `com.databricks.sdk.service.jobs.JobSettings`. * Removed `computeKey` field for `com.databricks.sdk.service.jobs.RunTask`. * Removed `com.databricks.sdk.service.jobs.TableTriggerConfiguration` class. * Removed `computeKey` field for `com.databricks.sdk.service.jobs.Task`. * Added `environmentKey` field for `com.databricks.sdk.service.jobs.Task`. * Changed `table` field for `com.databricks.sdk.service.jobs.TriggerSettings` to `com.databricks.sdk.service.jobs.TableUpdateTriggerConfiguration` class. * Changed `tableUpdate` field for `com.databricks.sdk.service.jobs.TriggerSettings` to `com.databricks.sdk.service.jobs.TableUpdateTriggerConfiguration` class. * Added `com.databricks.sdk.service.jobs.JobEnvironment` class. * Added `com.databricks.sdk.service.jobs.TableUpdateTriggerConfiguration` class. * Added `com.databricks.sdk.service.marketplace` package. OpenAPI SHA: 94684175b8bd65f8701f89729351f8069e8309c9, Date: 2024-04-11
### Improvements and Bug Fixes * Introduce more specific exceptions, like `NotFound`, `AlreadyExists`, `BadRequest`, `PermissionDenied`, `InternalError`, and others ([#185](#185), [#257](#257)). * Lock around field accessibility changes ([#247](#247)). * Fix Changelog ([#258](#258)). * Support post with no body for APIs ([#262](#262)). API Changes: * Changed `cancelRefresh()` method for `workspaceClient.lakehouseMonitors()` service with new required argument order. * Changed `create()` method for `workspaceClient.lakehouseMonitors()` service with new required argument order. * Changed `delete()` method for `workspaceClient.lakehouseMonitors()` service with new required argument order. * Changed `get()` method for `workspaceClient.lakehouseMonitors()` service with new required argument order. * Changed `getRefresh()` method for `workspaceClient.lakehouseMonitors()` service with new required argument order. * Changed `listRefreshes()` method for `workspaceClient.lakehouseMonitors()` service with new required argument order. * Changed `runRefresh()` method for `workspaceClient.lakehouseMonitors()` service with new required argument order. * Changed `update()` method for `workspaceClient.lakehouseMonitors()` service with new required argument order. * Removed `com.databricks.sdk.service.catalog.AzureManagedIdentity` class. * Removed `fullName` field for `com.databricks.sdk.service.catalog.CancelRefreshRequest`. * Added `tableName` field for `com.databricks.sdk.service.catalog.CancelRefreshRequest`. * Changed `customMetrics` field for `com.databricks.sdk.service.catalog.CreateMonitor` to `com.databricks.sdk.service.catalog.MonitorMetricList` class. * Removed `fullName` field for `com.databricks.sdk.service.catalog.CreateMonitor`. * Changed `inferenceLog` field for `com.databricks.sdk.service.catalog.CreateMonitor` to `com.databricks.sdk.service.catalog.MonitorInferenceLog` class. * Changed `notifications` field for `com.databricks.sdk.service.catalog.CreateMonitor` to `com.databricks.sdk.service.catalog.MonitorNotifications` class. * Changed `snapshot` field for `com.databricks.sdk.service.catalog.CreateMonitor` to `Object` class. * Changed `timeSeries` field for `com.databricks.sdk.service.catalog.CreateMonitor` to `com.databricks.sdk.service.catalog.MonitorTimeSeries` class. * Added `tableName` field for `com.databricks.sdk.service.catalog.CreateMonitor`. * Changed `azureManagedIdentity` field for `com.databricks.sdk.service.catalog.CreateStorageCredential` to `com.databricks.sdk.service.catalog.AzureManagedIdentityRequest` class. * Removed `fullName` field for `com.databricks.sdk.service.catalog.DeleteLakehouseMonitorRequest`. * Added `tableName` field for `com.databricks.sdk.service.catalog.DeleteLakehouseMonitorRequest`. * Removed `fullName` field for `com.databricks.sdk.service.catalog.GetLakehouseMonitorRequest`. * Added `tableName` field for `com.databricks.sdk.service.catalog.GetLakehouseMonitorRequest`. * Removed `fullName` field for `com.databricks.sdk.service.catalog.GetRefreshRequest`. * Added `tableName` field for `com.databricks.sdk.service.catalog.GetRefreshRequest`. * Removed `fullName` field for `com.databricks.sdk.service.catalog.ListRefreshesRequest`. * Added `tableName` field for `com.databricks.sdk.service.catalog.ListRefreshesRequest`. * Changed `quartzCronExpression` field for `com.databricks.sdk.service.catalog.MonitorCronSchedule` to be required. * Changed `timezoneId` field for `com.databricks.sdk.service.catalog.MonitorCronSchedule` to be required. * Removed `com.databricks.sdk.service.catalog.MonitorCustomMetric` class. * Removed `com.databricks.sdk.service.catalog.MonitorCustomMetricType` class. * Removed `com.databricks.sdk.service.catalog.MonitorDestinations` class. * Removed `com.databricks.sdk.service.catalog.MonitorInferenceLogProfileType` class. * Removed `com.databricks.sdk.service.catalog.MonitorInferenceLogProfileTypeProblemType` class. * Changed `customMetrics` field for `com.databricks.sdk.service.catalog.MonitorInfo` to `com.databricks.sdk.service.catalog.MonitorMetricList` class. * Changed `driftMetricsTableName` field for `com.databricks.sdk.service.catalog.MonitorInfo` to be required. * Changed `inferenceLog` field for `com.databricks.sdk.service.catalog.MonitorInfo` to `com.databricks.sdk.service.catalog.MonitorInferenceLog` class. * Changed `monitorVersion` field for `com.databricks.sdk.service.catalog.MonitorInfo` to be required. * Changed `notifications` field for `com.databricks.sdk.service.catalog.MonitorInfo` to `com.databricks.sdk.service.catalog.MonitorNotifications` class. * Changed `profileMetricsTableName` field for `com.databricks.sdk.service.catalog.MonitorInfo` to be required. * Changed `snapshot` field for `com.databricks.sdk.service.catalog.MonitorInfo` to `Object` class. * Changed `status` field for `com.databricks.sdk.service.catalog.MonitorInfo` to be required. * Changed `tableName` field for `com.databricks.sdk.service.catalog.MonitorInfo` to be required. * Changed `timeSeries` field for `com.databricks.sdk.service.catalog.MonitorInfo` to `com.databricks.sdk.service.catalog.MonitorTimeSeries` class. * Removed `com.databricks.sdk.service.catalog.MonitorNotificationsConfig` class. * Changed `refreshId` field for `com.databricks.sdk.service.catalog.MonitorRefreshInfo` to be required. * Changed `startTimeMs` field for `com.databricks.sdk.service.catalog.MonitorRefreshInfo` to be required. * Changed `state` field for `com.databricks.sdk.service.catalog.MonitorRefreshInfo` to be required. * Added `trigger` field for `com.databricks.sdk.service.catalog.MonitorRefreshInfo`. * Removed `Object` class. * Removed `com.databricks.sdk.service.catalog.MonitorTimeSeriesProfileType` class. * Removed `fullName` field for `com.databricks.sdk.service.catalog.RunRefreshRequest`. * Added `tableName` field for `com.databricks.sdk.service.catalog.RunRefreshRequest`. * Changed `azureManagedIdentity` field for `com.databricks.sdk.service.catalog.StorageCredentialInfo` to `com.databricks.sdk.service.catalog.AzureManagedIdentityResponse` class. * Removed `name` field for `com.databricks.sdk.service.catalog.TableRowFilter`. * Added `functionName` field for `com.databricks.sdk.service.catalog.TableRowFilter`. * Changed `customMetrics` field for `com.databricks.sdk.service.catalog.UpdateMonitor` to `com.databricks.sdk.service.catalog.MonitorMetricList` class. * Removed `fullName` field for `com.databricks.sdk.service.catalog.UpdateMonitor`. * Changed `inferenceLog` field for `com.databricks.sdk.service.catalog.UpdateMonitor` to `com.databricks.sdk.service.catalog.MonitorInferenceLog` class. * Changed `notifications` field for `com.databricks.sdk.service.catalog.UpdateMonitor` to `com.databricks.sdk.service.catalog.MonitorNotifications` class. * Changed `snapshot` field for `com.databricks.sdk.service.catalog.UpdateMonitor` to `Object` class. * Changed `timeSeries` field for `com.databricks.sdk.service.catalog.UpdateMonitor` to `com.databricks.sdk.service.catalog.MonitorTimeSeries` class. * Added `tableName` field for `com.databricks.sdk.service.catalog.UpdateMonitor`. * Changed `azureManagedIdentity` field for `com.databricks.sdk.service.catalog.UpdateStorageCredential` to `com.databricks.sdk.service.catalog.AzureManagedIdentityResponse` class. * Changed `azureManagedIdentity` field for `com.databricks.sdk.service.catalog.ValidateStorageCredential` to `com.databricks.sdk.service.catalog.AzureManagedIdentityRequest` class. * Removed `operation` field for `com.databricks.sdk.service.catalog.ValidationResult`. * Added `awsOperation` field for `com.databricks.sdk.service.catalog.ValidationResult`. * Added `azureOperation` field for `com.databricks.sdk.service.catalog.ValidationResult`. * Added `gcpOperation` field for `com.databricks.sdk.service.catalog.ValidationResult`. * Removed `com.databricks.sdk.service.catalog.ValidationResultOperation` class. * Added `com.databricks.sdk.service.catalog.AzureManagedIdentityRequest` class. * Added `com.databricks.sdk.service.catalog.AzureManagedIdentityResponse` class. * Added `com.databricks.sdk.service.catalog.MonitorDestination` class. * Added `com.databricks.sdk.service.catalog.MonitorInferenceLog` class. * Added `com.databricks.sdk.service.catalog.MonitorInferenceLogProblemType` class. * Added `com.databricks.sdk.service.catalog.MonitorMetric` class. * Added `com.databricks.sdk.service.catalog.MonitorMetricType` class. * Added `com.databricks.sdk.service.catalog.MonitorNotifications` class. * Added `com.databricks.sdk.service.catalog.MonitorRefreshInfoTrigger` class. * Added `Object` class. * Added `com.databricks.sdk.service.catalog.MonitorTimeSeries` class. * Added `com.databricks.sdk.service.catalog.ValidationResultAwsOperation` class. * Added `com.databricks.sdk.service.catalog.ValidationResultAzureOperation` class. * Added `com.databricks.sdk.service.catalog.ValidationResultGcpOperation` class. * Added `cloneFrom` field for `com.databricks.sdk.service.compute.ClusterSpec`. * Removed `com.databricks.sdk.service.compute.ComputeSpec` class. * Removed `com.databricks.sdk.service.compute.ComputeSpecKind` class. * Added `cloneFrom` field for `com.databricks.sdk.service.compute.CreateCluster`. * Added `cloneFrom` field for `com.databricks.sdk.service.compute.EditCluster`. * Added `com.databricks.sdk.service.compute.CloneCluster` class. * Added `com.databricks.sdk.service.compute.Environment` class. * Changed `update()` method for `accountClient.workspaceAssignment()` service to return `com.databricks.sdk.service.iam.PermissionAssignment` class. * Removed `Object` class. * Removed `computeKey` field for `com.databricks.sdk.service.jobs.ClusterSpec`. * Removed `compute` field for `com.databricks.sdk.service.jobs.CreateJob`. * Added `environments` field for `com.databricks.sdk.service.jobs.CreateJob`. * Removed `com.databricks.sdk.service.jobs.JobCompute` class. * Removed `compute` field for `com.databricks.sdk.service.jobs.JobSettings`. * Added `environments` field for `com.databricks.sdk.service.jobs.JobSettings`. * Removed `computeKey` field for `com.databricks.sdk.service.jobs.RunTask`. * Removed `com.databricks.sdk.service.jobs.TableTriggerConfiguration` class. * Removed `computeKey` field for `com.databricks.sdk.service.jobs.Task`. * Added `environmentKey` field for `com.databricks.sdk.service.jobs.Task`. * Changed `table` field for `com.databricks.sdk.service.jobs.TriggerSettings` to `com.databricks.sdk.service.jobs.TableUpdateTriggerConfiguration` class. * Changed `tableUpdate` field for `com.databricks.sdk.service.jobs.TriggerSettings` to `com.databricks.sdk.service.jobs.TableUpdateTriggerConfiguration` class. * Added `com.databricks.sdk.service.jobs.JobEnvironment` class. * Added `com.databricks.sdk.service.jobs.TableUpdateTriggerConfiguration` class. * Added `com.databricks.sdk.service.marketplace` package. OpenAPI SHA: 94684175b8bd65f8701f89729351f8069e8309c9, Date: 2024-04-11
… `BadRequest`, `PermissionDenied`, `InternalError`, and others (databricks#185) See implementations in other SDKs: - Go: databricks/databricks-sdk-go#682 - Python: databricks/databricks-sdk-py#376 --------- Co-authored-by: Miles Yucht <miles@databricks.com> Co-authored-by: Tanmay Rustagi <tanmay.rustagi@databricks.com>
### Improvements and Bug Fixes * Introduce more specific exceptions, like `NotFound`, `AlreadyExists`, `BadRequest`, `PermissionDenied`, `InternalError`, and others ([databricks#185](databricks#185), [databricks#257](databricks#257)). * Lock around field accessibility changes ([databricks#247](databricks#247)). * Fix Changelog ([databricks#258](databricks#258)). * Support post with no body for APIs ([databricks#262](databricks#262)). API Changes: * Changed `cancelRefresh()` method for `workspaceClient.lakehouseMonitors()` service with new required argument order. * Changed `create()` method for `workspaceClient.lakehouseMonitors()` service with new required argument order. * Changed `delete()` method for `workspaceClient.lakehouseMonitors()` service with new required argument order. * Changed `get()` method for `workspaceClient.lakehouseMonitors()` service with new required argument order. * Changed `getRefresh()` method for `workspaceClient.lakehouseMonitors()` service with new required argument order. * Changed `listRefreshes()` method for `workspaceClient.lakehouseMonitors()` service with new required argument order. * Changed `runRefresh()` method for `workspaceClient.lakehouseMonitors()` service with new required argument order. * Changed `update()` method for `workspaceClient.lakehouseMonitors()` service with new required argument order. * Removed `com.databricks.sdk.service.catalog.AzureManagedIdentity` class. * Removed `fullName` field for `com.databricks.sdk.service.catalog.CancelRefreshRequest`. * Added `tableName` field for `com.databricks.sdk.service.catalog.CancelRefreshRequest`. * Changed `customMetrics` field for `com.databricks.sdk.service.catalog.CreateMonitor` to `com.databricks.sdk.service.catalog.MonitorMetricList` class. * Removed `fullName` field for `com.databricks.sdk.service.catalog.CreateMonitor`. * Changed `inferenceLog` field for `com.databricks.sdk.service.catalog.CreateMonitor` to `com.databricks.sdk.service.catalog.MonitorInferenceLog` class. * Changed `notifications` field for `com.databricks.sdk.service.catalog.CreateMonitor` to `com.databricks.sdk.service.catalog.MonitorNotifications` class. * Changed `snapshot` field for `com.databricks.sdk.service.catalog.CreateMonitor` to `Object` class. * Changed `timeSeries` field for `com.databricks.sdk.service.catalog.CreateMonitor` to `com.databricks.sdk.service.catalog.MonitorTimeSeries` class. * Added `tableName` field for `com.databricks.sdk.service.catalog.CreateMonitor`. * Changed `azureManagedIdentity` field for `com.databricks.sdk.service.catalog.CreateStorageCredential` to `com.databricks.sdk.service.catalog.AzureManagedIdentityRequest` class. * Removed `fullName` field for `com.databricks.sdk.service.catalog.DeleteLakehouseMonitorRequest`. * Added `tableName` field for `com.databricks.sdk.service.catalog.DeleteLakehouseMonitorRequest`. * Removed `fullName` field for `com.databricks.sdk.service.catalog.GetLakehouseMonitorRequest`. * Added `tableName` field for `com.databricks.sdk.service.catalog.GetLakehouseMonitorRequest`. * Removed `fullName` field for `com.databricks.sdk.service.catalog.GetRefreshRequest`. * Added `tableName` field for `com.databricks.sdk.service.catalog.GetRefreshRequest`. * Removed `fullName` field for `com.databricks.sdk.service.catalog.ListRefreshesRequest`. * Added `tableName` field for `com.databricks.sdk.service.catalog.ListRefreshesRequest`. * Changed `quartzCronExpression` field for `com.databricks.sdk.service.catalog.MonitorCronSchedule` to be required. * Changed `timezoneId` field for `com.databricks.sdk.service.catalog.MonitorCronSchedule` to be required. * Removed `com.databricks.sdk.service.catalog.MonitorCustomMetric` class. * Removed `com.databricks.sdk.service.catalog.MonitorCustomMetricType` class. * Removed `com.databricks.sdk.service.catalog.MonitorDestinations` class. * Removed `com.databricks.sdk.service.catalog.MonitorInferenceLogProfileType` class. * Removed `com.databricks.sdk.service.catalog.MonitorInferenceLogProfileTypeProblemType` class. * Changed `customMetrics` field for `com.databricks.sdk.service.catalog.MonitorInfo` to `com.databricks.sdk.service.catalog.MonitorMetricList` class. * Changed `driftMetricsTableName` field for `com.databricks.sdk.service.catalog.MonitorInfo` to be required. * Changed `inferenceLog` field for `com.databricks.sdk.service.catalog.MonitorInfo` to `com.databricks.sdk.service.catalog.MonitorInferenceLog` class. * Changed `monitorVersion` field for `com.databricks.sdk.service.catalog.MonitorInfo` to be required. * Changed `notifications` field for `com.databricks.sdk.service.catalog.MonitorInfo` to `com.databricks.sdk.service.catalog.MonitorNotifications` class. * Changed `profileMetricsTableName` field for `com.databricks.sdk.service.catalog.MonitorInfo` to be required. * Changed `snapshot` field for `com.databricks.sdk.service.catalog.MonitorInfo` to `Object` class. * Changed `status` field for `com.databricks.sdk.service.catalog.MonitorInfo` to be required. * Changed `tableName` field for `com.databricks.sdk.service.catalog.MonitorInfo` to be required. * Changed `timeSeries` field for `com.databricks.sdk.service.catalog.MonitorInfo` to `com.databricks.sdk.service.catalog.MonitorTimeSeries` class. * Removed `com.databricks.sdk.service.catalog.MonitorNotificationsConfig` class. * Changed `refreshId` field for `com.databricks.sdk.service.catalog.MonitorRefreshInfo` to be required. * Changed `startTimeMs` field for `com.databricks.sdk.service.catalog.MonitorRefreshInfo` to be required. * Changed `state` field for `com.databricks.sdk.service.catalog.MonitorRefreshInfo` to be required. * Added `trigger` field for `com.databricks.sdk.service.catalog.MonitorRefreshInfo`. * Removed `Object` class. * Removed `com.databricks.sdk.service.catalog.MonitorTimeSeriesProfileType` class. * Removed `fullName` field for `com.databricks.sdk.service.catalog.RunRefreshRequest`. * Added `tableName` field for `com.databricks.sdk.service.catalog.RunRefreshRequest`. * Changed `azureManagedIdentity` field for `com.databricks.sdk.service.catalog.StorageCredentialInfo` to `com.databricks.sdk.service.catalog.AzureManagedIdentityResponse` class. * Removed `name` field for `com.databricks.sdk.service.catalog.TableRowFilter`. * Added `functionName` field for `com.databricks.sdk.service.catalog.TableRowFilter`. * Changed `customMetrics` field for `com.databricks.sdk.service.catalog.UpdateMonitor` to `com.databricks.sdk.service.catalog.MonitorMetricList` class. * Removed `fullName` field for `com.databricks.sdk.service.catalog.UpdateMonitor`. * Changed `inferenceLog` field for `com.databricks.sdk.service.catalog.UpdateMonitor` to `com.databricks.sdk.service.catalog.MonitorInferenceLog` class. * Changed `notifications` field for `com.databricks.sdk.service.catalog.UpdateMonitor` to `com.databricks.sdk.service.catalog.MonitorNotifications` class. * Changed `snapshot` field for `com.databricks.sdk.service.catalog.UpdateMonitor` to `Object` class. * Changed `timeSeries` field for `com.databricks.sdk.service.catalog.UpdateMonitor` to `com.databricks.sdk.service.catalog.MonitorTimeSeries` class. * Added `tableName` field for `com.databricks.sdk.service.catalog.UpdateMonitor`. * Changed `azureManagedIdentity` field for `com.databricks.sdk.service.catalog.UpdateStorageCredential` to `com.databricks.sdk.service.catalog.AzureManagedIdentityResponse` class. * Changed `azureManagedIdentity` field for `com.databricks.sdk.service.catalog.ValidateStorageCredential` to `com.databricks.sdk.service.catalog.AzureManagedIdentityRequest` class. * Removed `operation` field for `com.databricks.sdk.service.catalog.ValidationResult`. * Added `awsOperation` field for `com.databricks.sdk.service.catalog.ValidationResult`. * Added `azureOperation` field for `com.databricks.sdk.service.catalog.ValidationResult`. * Added `gcpOperation` field for `com.databricks.sdk.service.catalog.ValidationResult`. * Removed `com.databricks.sdk.service.catalog.ValidationResultOperation` class. * Added `com.databricks.sdk.service.catalog.AzureManagedIdentityRequest` class. * Added `com.databricks.sdk.service.catalog.AzureManagedIdentityResponse` class. * Added `com.databricks.sdk.service.catalog.MonitorDestination` class. * Added `com.databricks.sdk.service.catalog.MonitorInferenceLog` class. * Added `com.databricks.sdk.service.catalog.MonitorInferenceLogProblemType` class. * Added `com.databricks.sdk.service.catalog.MonitorMetric` class. * Added `com.databricks.sdk.service.catalog.MonitorMetricType` class. * Added `com.databricks.sdk.service.catalog.MonitorNotifications` class. * Added `com.databricks.sdk.service.catalog.MonitorRefreshInfoTrigger` class. * Added `Object` class. * Added `com.databricks.sdk.service.catalog.MonitorTimeSeries` class. * Added `com.databricks.sdk.service.catalog.ValidationResultAwsOperation` class. * Added `com.databricks.sdk.service.catalog.ValidationResultAzureOperation` class. * Added `com.databricks.sdk.service.catalog.ValidationResultGcpOperation` class. * Added `cloneFrom` field for `com.databricks.sdk.service.compute.ClusterSpec`. * Removed `com.databricks.sdk.service.compute.ComputeSpec` class. * Removed `com.databricks.sdk.service.compute.ComputeSpecKind` class. * Added `cloneFrom` field for `com.databricks.sdk.service.compute.CreateCluster`. * Added `cloneFrom` field for `com.databricks.sdk.service.compute.EditCluster`. * Added `com.databricks.sdk.service.compute.CloneCluster` class. * Added `com.databricks.sdk.service.compute.Environment` class. * Changed `update()` method for `accountClient.workspaceAssignment()` service to return `com.databricks.sdk.service.iam.PermissionAssignment` class. * Removed `Object` class. * Removed `computeKey` field for `com.databricks.sdk.service.jobs.ClusterSpec`. * Removed `compute` field for `com.databricks.sdk.service.jobs.CreateJob`. * Added `environments` field for `com.databricks.sdk.service.jobs.CreateJob`. * Removed `com.databricks.sdk.service.jobs.JobCompute` class. * Removed `compute` field for `com.databricks.sdk.service.jobs.JobSettings`. * Added `environments` field for `com.databricks.sdk.service.jobs.JobSettings`. * Removed `computeKey` field for `com.databricks.sdk.service.jobs.RunTask`. * Removed `com.databricks.sdk.service.jobs.TableTriggerConfiguration` class. * Removed `computeKey` field for `com.databricks.sdk.service.jobs.Task`. * Added `environmentKey` field for `com.databricks.sdk.service.jobs.Task`. * Changed `table` field for `com.databricks.sdk.service.jobs.TriggerSettings` to `com.databricks.sdk.service.jobs.TableUpdateTriggerConfiguration` class. * Changed `tableUpdate` field for `com.databricks.sdk.service.jobs.TriggerSettings` to `com.databricks.sdk.service.jobs.TableUpdateTriggerConfiguration` class. * Added `com.databricks.sdk.service.jobs.JobEnvironment` class. * Added `com.databricks.sdk.service.jobs.TableUpdateTriggerConfiguration` class. * Added `com.databricks.sdk.service.marketplace` package. OpenAPI SHA: 94684175b8bd65f8701f89729351f8069e8309c9, Date: 2024-04-11
See implementations in other SDKs:
errors.Is(err, databricks.ErrNotFound)
,errors.Is(err, databricks.ErrAlreadyExists)
,errors.Is(err, databricks.ErrBadRequest)
,errors.Is(err, databricks.ErrPermissionDenied)
,errors.Is(err, databricks.ErrInternal)
, and others databricks-sdk-go#682NotFound
,AlreadyExists
,BadRequest
,PermissionDenied
,InternalError
, and others databricks-sdk-py#376