Override INVALID_PARAMETER_VALUE on fetching non-existent job/cluster#864
Merged
Override INVALID_PARAMETER_VALUE on fetching non-existent job/cluster#864
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #864 +/- ##
========================================
+ Coverage 8.00% 8.04% +0.03%
========================================
Files 258 259 +1
Lines 64416 64441 +25
========================================
+ Hits 5155 5182 +27
+ Misses 58966 58959 -7
- Partials 295 300 +5 ☔ View full report in Codecov by Sentry. |
3 tasks
tanmay-db
approved these changes
Mar 22, 2024
apierr/error_override.go
Outdated
| return true | ||
| } | ||
|
|
||
| var invalidParameterValue = "INVALID_PARAMETER_VALUE" |
Contributor
There was a problem hiding this comment.
If we aren't changing this, then it would be good to have this as a constant
apierr/error_override.go
Outdated
|
|
||
| var invalidParameterValue = "INVALID_PARAMETER_VALUE" | ||
|
|
||
| var allOverrides = []errorOverride{ |
Contributor
There was a problem hiding this comment.
nit: Might be good to encapsulate this in a method so it's not accidentally modified.
apierr/error_override.go
Outdated
| pathRegex: regexp.MustCompile(`^/api/2\.0/clusters/get`), | ||
| verb: "GET", | ||
| messageMatcher: regexp.MustCompile("Cluster .* does not exist"), | ||
| errorCodeMatcher: regexp.MustCompile(invalidParameterValue), |
Contributor
There was a problem hiding this comment.
Should we have a statusCodeMatcher?
Contributor
Author
There was a problem hiding this comment.
Good idea, will add.
tanmay-db
approved these changes
Apr 2, 2024
github-merge-queue bot
pushed a commit
to databricks/databricks-sdk-py
that referenced
this pull request
Apr 3, 2024
…#591) ## Changes Port of databricks/databricks-sdk-go#864 to the Python SDK. Most services use RESOURCE_DOES_NOT_EXIST error code with 404 status code to indicate that a resource doesn't exist. However, for legacy reasons, Jobs and Clusters services use INVALID_PARAMETER_VALUE error code with 400 status code instead. This makes tools like Terraform and UCX difficult to maintain, as these services need different error handling logic. However, we can't change these behaviors as customers already depend on the raw HTTP response status & contents. This PR corrects these errors in the SDK itself. SDK users can then do ``` try: w.jobs.get_by_id('abc') except ResourceDoesNotExist: pass ``` just as you would expect from other resources. Updated the README with more information about this as well. ## Tests <!-- How is this tested? Please see the checklist below and also describe any other relevant tests --> - [ ] `make test` run locally - [ ] `make fmt` applied - [ ] relevant integration tests applied
3 tasks
mgyucht
added a commit
that referenced
this pull request
Apr 11, 2024
### Behavior Changes * Override INVALID_PARAMETER_VALUE on fetching non-existent job/cluster ([#864](#864)). The error returned when fetching a non-existent job or cluster has been changed from `INVALID_PARAMETER_VALUE` to `RESOURCE_DOES_NOT_EXIST`. Update your error handling code to check for `databricks.ErrResourceDoesNotExist` instead of `databricks.ErrInvalidParameterValue`. For example, if you are using the `Jobs.GetById` method, you should update your error handling code to: ```go _, err := w.Jobs.GetById(ctx, "id") if errors.Is(err, databricks.ErrResourceDoesNotExist) { // handle the error } ``` Note that the original error code is still accessible in the `ErrorCode` field of `APIError`. ### Other Improvements * Do not leak secondary authorization tokens in debug logs ([#882](#882)). * Fix logging of request bodies containing percent characters. ([#881](#881)). * Added clientId and clientSecret to oauth-m2m auth_types ([#885](#885)). ### Internal Changes * Support custom AuthVisitors ([#874](#874)). API Changes: * Replaced [catalog.AzureManagedIdentity](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#AzureManagedIdentity) with [catalog.AzureManagedIdentityRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#AzureManagedIdentityRequest) and [catalog.AzureManagedIdentityResponse](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#AzureManagedIdentityResponse). * Renamed `FullName` field to `TableName` for [catalog.CancelRefreshRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CancelRefreshRequest), [catalog.CreateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CreateMonitor), [catalog.DeleteLakehouseMonitorRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#DeleteLakehouseMonitorRequest), [catalog.GetLakehouseMonitorRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#GetLakehouseMonitorRequest), [catalog.GetRefreshRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#GetRefreshRequest), [catalog.ListRefreshesRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ListRefreshesRequest). * Changed `CustomMetrics` field for [catalog.CreateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CreateMonitor) to [catalog.MonitorMetricList](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorMetricList). * Changed `InferenceLog` field for [catalog.CreateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CreateMonitor) to [catalog.MonitorInferenceLog](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInferenceLog). * Changed `Notifications` field for [catalog.CreateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CreateMonitor) to [catalog.MonitorNotifications](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorNotifications). * Changed `Snapshot` field for [catalog.CreateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CreateMonitor) to `any`. * Changed `TimeSeries` field for [catalog.CreateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CreateMonitor) to [catalog.MonitorTimeSeries](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorTimeSeries). * Changed `QuartzCronExpression` field for [catalog.MonitorCronSchedule](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorCronSchedule) to be required. * Changed `TimezoneId` field for [catalog.MonitorCronSchedule](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorCronSchedule) to be required. * Renamed [catalog.MonitorCustomMetric](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorCustomMetric) to [catalog.MonitorMetric](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorMetric). * Renamed [catalog.MonitorCustomMetricType](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorCustomMetricType) to [catalog.MonitorMetricType](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorMetricType). * Renamed [catalog.MonitorDestinations](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorDestinations) to [catalog.MonitorDestination](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorDestination). * Renamed [catalog.MonitorInferenceLogProfileType](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInferenceLogProfileType) to [catalog.MonitorInferenceLog](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInferenceLog). * Renamed [catalog.MonitorInferenceLogProfileTypeProblemType](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInferenceLogProfileTypeProblemType) to [catalog.MonitorInferenceLogProblemType](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInferenceLogProblemType). * Renamed [catalog.MonitorNotificationsConfig](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorNotificationsConfig) to [catalog.MonitorNotifications](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorNotifications). * Changed `CustomMetrics` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to [catalog.MonitorMetricList](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorMetricList). * Changed `DriftMetricsTableName` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to be required. * Changed `InferenceLog` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to [catalog.MonitorInferenceLog](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInferenceLog). * Changed `MonitorVersion` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to be required. * Changed `Notifications` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to [catalog.MonitorNotifications](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorNotifications). * Changed `ProfileMetricsTableName` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to be required. * Changed `Snapshot` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to `any`. * Changed `Status` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to be required. * Changed `TableName` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to be required. * Changed `TimeSeries` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to [catalog.MonitorTimeSeries](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorTimeSeries). * Changed `RefreshId` field for [catalog.MonitorRefreshInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorRefreshInfo) to be required. * Changed `StartTimeMs` field for [catalog.MonitorRefreshInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorRefreshInfo) to be required. * Changed `State` field for [catalog.MonitorRefreshInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorRefreshInfo) to be required. * Added `Trigger` field for [catalog.MonitorRefreshInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorRefreshInfo). * Removed [catalog.MonitorTimeSeriesProfileType](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorTimeSeriesProfileType). * Removed `FullName` field for [catalog.RunRefreshRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#RunRefreshRequest). * Added `TableName` field for [catalog.RunRefreshRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#RunRefreshRequest). * Changed `AzureManagedIdentity` field for [catalog.StorageCredentialInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#StorageCredentialInfo) to . * Removed `Name` field for [catalog.TableRowFilter](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#TableRowFilter). * Added `FunctionName` field for [catalog.TableRowFilter](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#TableRowFilter). * Changed `CustomMetrics` field for [catalog.UpdateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateMonitor) to [catalog.MonitorMetricList](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorMetricList). * Removed `FullName` field for [catalog.UpdateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateMonitor). * Changed `InferenceLog` field for [catalog.UpdateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateMonitor) to [catalog.MonitorInferenceLog](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInferenceLog). * Changed `Notifications` field for [catalog.UpdateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateMonitor) to [catalog.MonitorNotifications](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorNotifications). * Changed `Snapshot` field for [catalog.UpdateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateMonitor) to `any`. * Changed `TimeSeries` field for [catalog.UpdateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateMonitor) to [catalog.MonitorTimeSeries](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorTimeSeries). * Added `TableName` field for [catalog.UpdateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateMonitor). * Changed `AzureManagedIdentity` field for [catalog.UpdateStorageCredential](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateStorageCredential) to [catalog.AzureManagedIdentityResponse](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#AzureManagedIdentityResponse). * Changed `AzureManagedIdentity` field for [catalog.ValidateStorageCredential](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ValidateStorageCredential) to [catalog.AzureManagedIdentityRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#AzureManagedIdentityRequest). * Replaced `Operation` field for [catalog.ValidationResult](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ValidationResult) with `AwsOperation`, `AzureOperation` and `GcpOperation`. * Replaced [catalog.ValidationResultOperation](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ValidationResultOperation) with [catalog.ValidationResultAwsOperation](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ValidationResultAwsOperation), [catalog.ValidationResultAzureOperation](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ValidationResultAzureOperation) and [catalog.ValidationResultGcpOperation](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ValidationResultGcpOperation). * Added [catalog.MonitorRefreshInfoTrigger](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorRefreshInfoTrigger). * Added [catalog.MonitorTimeSeries](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorTimeSeries). * Removed [compute.ComputeSpec](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#ComputeSpec). * Removed [compute.ComputeSpecKind](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#ComputeSpecKind). * Added `CloneFrom` field to [compute.CreateCluster](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#CreateCluster), [compute.ClusterSpec](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#ClusterSpec), and [compute.EditCluster](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#EditCluster). * Added [compute.CloneCluster](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#CloneCluster). * Added [compute.Environment](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#Environment). * Changed `Update` method for [a.WorkspaceAssignment](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/iam#WorkspaceAssignmentAPI) account-level service to return [iam.PermissionAssignment](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/iam#PermissionAssignment). * Removed `ComputeKey` field for [jobs.ClusterSpec](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#ClusterSpec). * Removed `Compute` field for [jobs.CreateJob](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#CreateJob). * Added `Environments` field for [jobs.CreateJob](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#CreateJob). * Removed [jobs.JobCompute](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#JobCompute). * Removed `Compute` field for [jobs.JobSettings](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#JobSettings). * Added `Environments` field for [jobs.JobSettings](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#JobSettings). * Removed `ComputeKey` field for [jobs.RunTask](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#RunTask). * Removed [jobs.TableTriggerConfiguration](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TableTriggerConfiguration). * Removed `ComputeKey` field for [jobs.Task](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#Task). * Added `EnvironmentKey` field for [jobs.Task](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#Task). * Changed `Table` field for [jobs.TriggerSettings](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TriggerSettings) to [jobs.TableUpdateTriggerConfiguration](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TableUpdateTriggerConfiguration). * Changed `TableUpdate` field for [jobs.TriggerSettings](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TriggerSettings) to [jobs.TableUpdateTriggerConfiguration](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TableUpdateTriggerConfiguration). * Added [jobs.JobEnvironment](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#JobEnvironment). * Added [jobs.TableUpdateTriggerConfiguration](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TableUpdateTriggerConfiguration). * Added [marketplace](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/marketplace) package. OpenAPI SHA: 94684175b8bd65f8701f89729351f8069e8309c9, Date: 2024-04-11
Merged
github-merge-queue bot
pushed a commit
that referenced
this pull request
Apr 11, 2024
### Behavior Changes * Override INVALID_PARAMETER_VALUE on fetching non-existent job/cluster ([#864](#864)). The error returned when fetching a non-existent job or cluster has been changed from `INVALID_PARAMETER_VALUE` to `RESOURCE_DOES_NOT_EXIST`. Update your error handling code to check for `databricks.ErrResourceDoesNotExist` instead of `databricks.ErrInvalidParameterValue`. For example, if you are using the `Jobs.GetById` method, you should update your error handling code to: ```go _, err := w.Jobs.GetById(ctx, "id") if errors.Is(err, databricks.ErrResourceDoesNotExist) { // handle the error } ``` Note that the original error code is still accessible in the `ErrorCode` field of `APIError`. ### Other Improvements * Do not leak secondary authorization tokens in debug logs ([#882](#882)). * Fix logging of request bodies containing percent characters. ([#881](#881)). * Added clientId and clientSecret to oauth-m2m auth_types ([#885](#885)). ### Internal Changes * Support custom AuthVisitors ([#874](#874)). API Changes: * Replaced [catalog.AzureManagedIdentity](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#AzureManagedIdentity) with [catalog.AzureManagedIdentityRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#AzureManagedIdentityRequest) and [catalog.AzureManagedIdentityResponse](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#AzureManagedIdentityResponse). * Renamed `FullName` field to `TableName` for [catalog.CancelRefreshRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CancelRefreshRequest), [catalog.CreateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CreateMonitor), [catalog.DeleteLakehouseMonitorRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#DeleteLakehouseMonitorRequest), [catalog.GetLakehouseMonitorRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#GetLakehouseMonitorRequest), [catalog.GetRefreshRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#GetRefreshRequest), [catalog.ListRefreshesRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ListRefreshesRequest). * Changed `CustomMetrics` field for [catalog.CreateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CreateMonitor) to [catalog.MonitorMetricList](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorMetricList). * Changed `InferenceLog` field for [catalog.CreateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CreateMonitor) to [catalog.MonitorInferenceLog](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInferenceLog). * Changed `Notifications` field for [catalog.CreateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CreateMonitor) to [catalog.MonitorNotifications](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorNotifications). * Changed `Snapshot` field for [catalog.CreateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CreateMonitor) to `any`. * Changed `TimeSeries` field for [catalog.CreateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#CreateMonitor) to [catalog.MonitorTimeSeries](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorTimeSeries). * Changed `QuartzCronExpression` field for [catalog.MonitorCronSchedule](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorCronSchedule) to be required. * Changed `TimezoneId` field for [catalog.MonitorCronSchedule](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorCronSchedule) to be required. * Renamed [catalog.MonitorCustomMetric](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorCustomMetric) to [catalog.MonitorMetric](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorMetric). * Renamed [catalog.MonitorCustomMetricType](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorCustomMetricType) to [catalog.MonitorMetricType](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorMetricType). * Renamed [catalog.MonitorDestinations](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorDestinations) to [catalog.MonitorDestination](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorDestination). * Renamed [catalog.MonitorInferenceLogProfileType](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInferenceLogProfileType) to [catalog.MonitorInferenceLog](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInferenceLog). * Renamed [catalog.MonitorInferenceLogProfileTypeProblemType](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInferenceLogProfileTypeProblemType) to [catalog.MonitorInferenceLogProblemType](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInferenceLogProblemType). * Renamed [catalog.MonitorNotificationsConfig](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorNotificationsConfig) to [catalog.MonitorNotifications](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorNotifications). * Changed `CustomMetrics` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to [catalog.MonitorMetricList](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorMetricList). * Changed `DriftMetricsTableName` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to be required. * Changed `InferenceLog` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to [catalog.MonitorInferenceLog](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInferenceLog). * Changed `MonitorVersion` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to be required. * Changed `Notifications` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to [catalog.MonitorNotifications](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorNotifications). * Changed `ProfileMetricsTableName` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to be required. * Changed `Snapshot` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to `any`. * Changed `Status` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to be required. * Changed `TableName` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to be required. * Changed `TimeSeries` field for [catalog.MonitorInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInfo) to [catalog.MonitorTimeSeries](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorTimeSeries). * Changed `RefreshId` field for [catalog.MonitorRefreshInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorRefreshInfo) to be required. * Changed `StartTimeMs` field for [catalog.MonitorRefreshInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorRefreshInfo) to be required. * Changed `State` field for [catalog.MonitorRefreshInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorRefreshInfo) to be required. * Added `Trigger` field for [catalog.MonitorRefreshInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorRefreshInfo). * Removed [catalog.MonitorTimeSeriesProfileType](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorTimeSeriesProfileType). * Removed `FullName` field for [catalog.RunRefreshRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#RunRefreshRequest). * Added `TableName` field for [catalog.RunRefreshRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#RunRefreshRequest). * Changed `AzureManagedIdentity` field for [catalog.StorageCredentialInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#StorageCredentialInfo) to . * Removed `Name` field for [catalog.TableRowFilter](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#TableRowFilter). * Added `FunctionName` field for [catalog.TableRowFilter](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#TableRowFilter). * Changed `CustomMetrics` field for [catalog.UpdateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateMonitor) to [catalog.MonitorMetricList](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorMetricList). * Removed `FullName` field for [catalog.UpdateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateMonitor). * Changed `InferenceLog` field for [catalog.UpdateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateMonitor) to [catalog.MonitorInferenceLog](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorInferenceLog). * Changed `Notifications` field for [catalog.UpdateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateMonitor) to [catalog.MonitorNotifications](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorNotifications). * Changed `Snapshot` field for [catalog.UpdateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateMonitor) to `any`. * Changed `TimeSeries` field for [catalog.UpdateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateMonitor) to [catalog.MonitorTimeSeries](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorTimeSeries). * Added `TableName` field for [catalog.UpdateMonitor](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateMonitor). * Changed `AzureManagedIdentity` field for [catalog.UpdateStorageCredential](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#UpdateStorageCredential) to [catalog.AzureManagedIdentityResponse](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#AzureManagedIdentityResponse). * Changed `AzureManagedIdentity` field for [catalog.ValidateStorageCredential](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ValidateStorageCredential) to [catalog.AzureManagedIdentityRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#AzureManagedIdentityRequest). * Replaced `Operation` field for [catalog.ValidationResult](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ValidationResult) with `AwsOperation`, `AzureOperation` and `GcpOperation`. * Replaced [catalog.ValidationResultOperation](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ValidationResultOperation) with [catalog.ValidationResultAwsOperation](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ValidationResultAwsOperation), [catalog.ValidationResultAzureOperation](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ValidationResultAzureOperation) and [catalog.ValidationResultGcpOperation](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#ValidationResultGcpOperation). * Added [catalog.MonitorRefreshInfoTrigger](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorRefreshInfoTrigger). * Added [catalog.MonitorTimeSeries](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#MonitorTimeSeries). * Removed [compute.ComputeSpec](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#ComputeSpec). * Removed [compute.ComputeSpecKind](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#ComputeSpecKind). * Added `CloneFrom` field to [compute.CreateCluster](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#CreateCluster), [compute.ClusterSpec](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#ClusterSpec), and [compute.EditCluster](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#EditCluster). * Added [compute.CloneCluster](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#CloneCluster). * Added [compute.Environment](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/compute#Environment). * Changed `Update` method for [a.WorkspaceAssignment](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/iam#WorkspaceAssignmentAPI) account-level service to return [iam.PermissionAssignment](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/iam#PermissionAssignment). * Removed `ComputeKey` field for [jobs.ClusterSpec](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#ClusterSpec). * Removed `Compute` field for [jobs.CreateJob](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#CreateJob). * Added `Environments` field for [jobs.CreateJob](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#CreateJob). * Removed [jobs.JobCompute](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#JobCompute). * Removed `Compute` field for [jobs.JobSettings](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#JobSettings). * Added `Environments` field for [jobs.JobSettings](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#JobSettings). * Removed `ComputeKey` field for [jobs.RunTask](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#RunTask). * Removed [jobs.TableTriggerConfiguration](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TableTriggerConfiguration). * Removed `ComputeKey` field for [jobs.Task](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#Task). * Added `EnvironmentKey` field for [jobs.Task](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#Task). * Changed `Table` field for [jobs.TriggerSettings](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TriggerSettings) to [jobs.TableUpdateTriggerConfiguration](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TableUpdateTriggerConfiguration). * Changed `TableUpdate` field for [jobs.TriggerSettings](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TriggerSettings) to [jobs.TableUpdateTriggerConfiguration](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TableUpdateTriggerConfiguration). * Added [jobs.JobEnvironment](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#JobEnvironment). * Added [jobs.TableUpdateTriggerConfiguration](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#TableUpdateTriggerConfiguration). * Added [marketplace](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/marketplace) package. OpenAPI SHA: 94684175b8bd65f8701f89729351f8069e8309c9, Date: 2024-04-11
github-merge-queue bot
pushed a commit
to databricks/databricks-sdk-java
that referenced
this pull request
Apr 11, 2024
…#257) ## Changes Ports databricks/databricks-sdk-go#864 to the Java SDK. Most services use `RESOURCE_DOES_NOT_EXIST` error code with 404 status code to indicate that a resource doesn't exist. However, for legacy reasons, Jobs and Clusters services use `INVALID_PARAMETER_VALUE` error code with 400 status code instead. This makes tools like Terraform and UCX difficult to maintain, as these services need different error handling logic. However, we can't change these behaviors as customers already depend on the raw HTTP response status & contents. This PR corrects these errors in the SDK itself. SDK users can then do ```java try { BaseJob job = w.jobs().get("123"); } catch (ResourceDoesNotExist e) { ... } ``` just as you would expect from other resources. Updated the README with more information about this as well. ## Tests Added unit tests for error overrides. Added/updated the integration tests for Clusters and Jobs. - [x] `make test` passing - [x] `make fmt` applied - [x] relevant integration tests applied
vikrantpuppala
pushed a commit
to vikrantpuppala/databricks-sdk-java
that referenced
this pull request
Apr 23, 2024
…databricks#257) ## Changes Ports databricks/databricks-sdk-go#864 to the Java SDK. Most services use `RESOURCE_DOES_NOT_EXIST` error code with 404 status code to indicate that a resource doesn't exist. However, for legacy reasons, Jobs and Clusters services use `INVALID_PARAMETER_VALUE` error code with 400 status code instead. This makes tools like Terraform and UCX difficult to maintain, as these services need different error handling logic. However, we can't change these behaviors as customers already depend on the raw HTTP response status & contents. This PR corrects these errors in the SDK itself. SDK users can then do ```java try { BaseJob job = w.jobs().get("123"); } catch (ResourceDoesNotExist e) { ... } ``` just as you would expect from other resources. Updated the README with more information about this as well. ## Tests Added unit tests for error overrides. Added/updated the integration tests for Clusters and Jobs. - [x] `make test` passing - [x] `make fmt` applied - [x] relevant integration tests applied
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.
Changes
Most services use
RESOURCE_DOES_NOT_EXISTerror code with 404 status code to indicate that a resource doesn't exist. However, for legacy reasons, Jobs and Clusters services useINVALID_PARAMETER_VALUEerror code with 400 status code instead. This makes tools like Terraform and UCX difficult to maintain, as these services need different error handling logic. However, we can't change these behaviors as customers already depend on the raw HTTP response status & contents.This PR corrects these errors in the SDK itself. SDK users can then do
just as you would expect from other resources.
Updated the README with more information about this as well.
Tests
Added unit tests for error overrides.
Added 2 integration tests for Clusters and Jobs.
make testpassingmake fmtapplied