Skip to content
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

Add ErrorInfo to API errors #153

Merged
merged 4 commits into from
Sep 15, 2023
Merged

Add ErrorInfo to API errors #153

merged 4 commits into from
Sep 15, 2023

Conversation

hectorcast-db
Copy link
Contributor

@hectorcast-db hectorcast-db commented Sep 14, 2023

Changes

Databricks API can return error details in case of errors. In some cases, users need to access such details to be able to solve the issue. This is the case for the errors of type ErrorInfo used by the Settings Platform.
This PR adds the necessary fields to the APIError to Unmarshal the ErrorDetails and to expose the details of type ErrorInfo to the users.

Tests

  • Unit test
  • make fmt
  • Integration test

Add details field to APIError and DatabricksError to contain the details of the errors returned by the API.
Also add a method to return the details of type ErrorInfo.
@hectorcast-db hectorcast-db added this pull request to the merge queue Sep 15, 2023
Merged via the queue into main with commit 00052d4 Sep 15, 2023
9 checks passed
@hectorcast-db hectorcast-db deleted the error-details branch September 15, 2023 13:07
mgyucht added a commit that referenced this pull request Oct 3, 2023
* Add additional error metadata to API errors ([#153](#153)).
* Bugfix: Chunk streaming request bodies only ([#157](#157)).
* Relicense the Java SDK using the Apache 2.0 license ([#158](#158)).

Breaking API Changes:

 * Changed `list()` method for `accountClient.metastoreAssignments()` service to return `com.databricks.sdk.service.catalog.ListAccountMetastoreAssignmentsResponse` class.
 * Changed `artifactMatchers` field for `com.databricks.sdk.service.catalog.ArtifactAllowlistInfo` to `com.databricks.sdk.service.catalog.ArtifactMatcherList` class.
 * Removed `owner` field for `com.databricks.sdk.service.catalog.CreateConnection`. Use instead the `owner` field of `UpdateConnection`.
 * Changed `artifactMatchers` field for `com.databricks.sdk.service.catalog.SetArtifactAllowlist` to `com.databricks.sdk.service.catalog.ArtifactMatcherList` class.
 * Removed `options` field for `com.databricks.sdk.service.catalog.UpdateCatalog`.
 * Changed `cancelAllRuns()` method for `workspaceClient.jobs()` service with new required argument order.
 * Changed `jobId` field for `com.databricks.sdk.service.jobs.CancelAllRuns` to no longer be required.
 * Changed `jobParameters` field for `com.databricks.sdk.service.jobs.RunNow` to `com.databricks.sdk.service.jobs.ParamPairs` class.
 * Changed `query()` method for `workspaceClient.servingEndpoints()` service. New request type is `com.databricks.sdk.service.serving.QueryEndpointInput` class.
 * Removed `com.databricks.sdk.service.serving.QueryRequest` class.
 * Changed `list()` method for `workspaceClient.cleanRooms()` service to require request of `com.databricks.sdk.service.sharing.ListCleanRoomsRequest` class.
 * Changed `executeStatement()` method for `workspaceClient.statementExecution()` service with new required argument order.
 * Renamed `com.databricks.sdk.service.sql.ChunkInfo` class to `BaseChunkInfo`.
 * Changed `onWaitTimeout` field for `com.databricks.sdk.service.sql.ExecuteStatementRequest` to `com.databricks.sdk.service.sql.ExecuteStatementRequestOnWaitTimeout` class.
 * Changed `statement` field for `com.databricks.sdk.service.sql.ExecuteStatementRequest` to be required.
 * Changed `warehouseId` field for `com.databricks.sdk.service.sql.ExecuteStatementRequest` to be required.
 * Changed `chunks` field for `com.databricks.sdk.service.sql.ResultManifest` to `com.databricks.sdk.service.sql.BaseChunkInfoList` class.
 * Renamed `com.databricks.sdk.service.sql.TimeoutAction` class to `ExecuteStatementRequestOnWaitTimeout`.

API Changes:

 * Added `com.databricks.sdk.service.catalog.ListAccountMetastoreAssignmentsResponse` class.
 * Added `com.databricks.sdk.service.catalog.WorkspaceId` class.
 * Added `allQueuedRuns` field for `com.databricks.sdk.service.jobs.CancelAllRuns`.
 * Added `queue` field for `com.databricks.sdk.service.jobs.CreateJob`.
 * Added `queue` field for `com.databricks.sdk.service.jobs.JobSettings`.
 * Added `jobParameters` field for `com.databricks.sdk.service.jobs.RepairRun`.
 * Added `queue` field for `com.databricks.sdk.service.jobs.RunNow`.
 * Added `jobParameters` field for `com.databricks.sdk.service.jobs.RunParameters`.
 * Added `queueReason` field for `com.databricks.sdk.service.jobs.RunState`.
 * Added `queueDuration` field for `com.databricks.sdk.service.jobs.RunTask`.
 * Added `queue` field for `com.databricks.sdk.service.jobs.SubmitRun`.
 * Added `com.databricks.sdk.service.jobs.QueueSettings` class.
 * Added `accountClient.oAuthPublishedApps()` service.
 * Added `com.databricks.sdk.service.oauth2.GetPublishedAppsOutput` class.
 * Added `com.databricks.sdk.service.oauth2.ListOAuthPublishedAppsRequest` class.
 * Added `com.databricks.sdk.service.oauth2.PublishedAppOutput` class.
 * Added `notifications` field for `com.databricks.sdk.service.pipelines.CreatePipeline`.
 * Added `notifications` field for `com.databricks.sdk.service.pipelines.EditPipeline`.
 * Added `notifications` field for `com.databricks.sdk.service.pipelines.PipelineSpec`.
 * Added `com.databricks.sdk.service.pipelines.Notifications` class.
 * Added `patch()` method for `workspaceClient.servingEndpoints()` service.
 * Added `tags` field for `com.databricks.sdk.service.serving.CreateServingEndpoint`.
 * Added `tags` field for `com.databricks.sdk.service.serving.ServingEndpoint`.
 * Added `tags` field for `com.databricks.sdk.service.serving.ServingEndpointDetailed`.
 * Added `com.databricks.sdk.service.serving.DataframeSplitInput` class.
 * Added `com.databricks.sdk.service.serving.EndpointTag` class.
 * Added `com.databricks.sdk.service.serving.PatchServingEndpointTags` class.
 * Added `com.databricks.sdk.service.serving.QueryEndpointInput` class.
 * Added `workspaceClient.credentialsManager()` service.
 * Added `workspaceClient.settings()` service.
 * Added `com.databricks.sdk.service.settings.DefaultNamespaceSetting` class.
 * Added `com.databricks.sdk.service.settings.DeleteDefaultWorkspaceNamespaceRequest` class.
 * Added `com.databricks.sdk.service.settings.DeleteDefaultWorkspaceNamespaceResponse` class.
 * Added `com.databricks.sdk.service.settings.ExchangeToken` class.
 * Added `com.databricks.sdk.service.settings.ExchangeTokenRequest` class.
 * Added `com.databricks.sdk.service.settings.ExchangeTokenResponse` class.
 * Added `com.databricks.sdk.service.settings.PartitionId` class.
 * Added `com.databricks.sdk.service.settings.ReadDefaultWorkspaceNamespaceRequest` class.
 * Added `com.databricks.sdk.service.settings.StringMessage` class.
 * Added `com.databricks.sdk.service.settings.TokenType` class.
 * Added `com.databricks.sdk.service.settings.UpdateDefaultWorkspaceNamespaceRequest` class.
 * Added `nextPageToken` field for `com.databricks.sdk.service.sharing.ListCleanRoomsResponse`.
 * Added `com.databricks.sdk.service.sharing.ListCleanRoomsRequest` class.
 * Added `emptyResultState` field for `com.databricks.sdk.service.sql.AlertOptions`.
 * Added `truncated` field for `com.databricks.sdk.service.sql.ResultManifest`.
 * Added `com.databricks.sdk.service.sql.AlertOptionsEmptyResultState` class.

OpenAPI SHA: bcbf6e851e3d82fd910940910dd31c10c059746c, Date: 2023-10-02
@mgyucht mgyucht mentioned this pull request Oct 3, 2023
github-merge-queue bot pushed a commit that referenced this pull request Oct 3, 2023
* Add additional error metadata to API errors
([#153](#153)).
* Bugfix: Chunk streaming request bodies only
([#157](#157)).
* Relicense the Java SDK using the Apache 2.0 license
([#158](#158)).

Breaking API Changes:

* Changed `list()` method for `accountClient.metastoreAssignments()`
service to return
`com.databricks.sdk.service.catalog.ListAccountMetastoreAssignmentsResponse`
class.
* Changed `artifactMatchers` field for
`com.databricks.sdk.service.catalog.ArtifactAllowlistInfo` to
`com.databricks.sdk.service.catalog.ArtifactMatcherList` class.
* Removed `owner` field for
`com.databricks.sdk.service.catalog.CreateConnection`. Use instead the
`owner` field of `UpdateConnection`.
* Changed `artifactMatchers` field for
`com.databricks.sdk.service.catalog.SetArtifactAllowlist` to
`com.databricks.sdk.service.catalog.ArtifactMatcherList` class.
* Removed `options` field for
`com.databricks.sdk.service.catalog.UpdateCatalog`.
* Changed `cancelAllRuns()` method for `workspaceClient.jobs()` service
with new required argument order.
* Changed `jobId` field for
`com.databricks.sdk.service.jobs.CancelAllRuns` to no longer be
required.
* Changed `jobParameters` field for
`com.databricks.sdk.service.jobs.RunNow` to
`com.databricks.sdk.service.jobs.ParamPairs` class.
* Changed `query()` method for `workspaceClient.servingEndpoints()`
service. New request type is
`com.databricks.sdk.service.serving.QueryEndpointInput` class.
 * Removed `com.databricks.sdk.service.serving.QueryRequest` class.
* Changed `list()` method for `workspaceClient.cleanRooms()` service to
require request of
`com.databricks.sdk.service.sharing.ListCleanRoomsRequest` class.
* Changed `executeStatement()` method for
`workspaceClient.statementExecution()` service with new required
argument order.
* Renamed `com.databricks.sdk.service.sql.ChunkInfo` class to
`BaseChunkInfo`.
* Changed `onWaitTimeout` field for
`com.databricks.sdk.service.sql.ExecuteStatementRequest` to
`com.databricks.sdk.service.sql.ExecuteStatementRequestOnWaitTimeout`
class.
* Changed `statement` field for
`com.databricks.sdk.service.sql.ExecuteStatementRequest` to be required.
* Changed `warehouseId` field for
`com.databricks.sdk.service.sql.ExecuteStatementRequest` to be required.
* Changed `chunks` field for
`com.databricks.sdk.service.sql.ResultManifest` to
`com.databricks.sdk.service.sql.BaseChunkInfoList` class.
* Renamed `com.databricks.sdk.service.sql.TimeoutAction` class to
`ExecuteStatementRequestOnWaitTimeout`.

API Changes:

* Added
`com.databricks.sdk.service.catalog.ListAccountMetastoreAssignmentsResponse`
class.
 * Added `com.databricks.sdk.service.catalog.WorkspaceId` class.
* Added `allQueuedRuns` field for
`com.databricks.sdk.service.jobs.CancelAllRuns`.
 * Added `queue` field for `com.databricks.sdk.service.jobs.CreateJob`.
* Added `queue` field for `com.databricks.sdk.service.jobs.JobSettings`.
* Added `jobParameters` field for
`com.databricks.sdk.service.jobs.RepairRun`.
 * Added `queue` field for `com.databricks.sdk.service.jobs.RunNow`.
* Added `jobParameters` field for
`com.databricks.sdk.service.jobs.RunParameters`.
* Added `queueReason` field for
`com.databricks.sdk.service.jobs.RunState`.
* Added `queueDuration` field for
`com.databricks.sdk.service.jobs.RunTask`.
 * Added `queue` field for `com.databricks.sdk.service.jobs.SubmitRun`.
 * Added `com.databricks.sdk.service.jobs.QueueSettings` class.
 * Added `accountClient.oAuthPublishedApps()` service.
* Added `com.databricks.sdk.service.oauth2.GetPublishedAppsOutput`
class.
* Added
`com.databricks.sdk.service.oauth2.ListOAuthPublishedAppsRequest` class.
 * Added `com.databricks.sdk.service.oauth2.PublishedAppOutput` class.
* Added `notifications` field for
`com.databricks.sdk.service.pipelines.CreatePipeline`.
* Added `notifications` field for
`com.databricks.sdk.service.pipelines.EditPipeline`.
* Added `notifications` field for
`com.databricks.sdk.service.pipelines.PipelineSpec`.
 * Added `com.databricks.sdk.service.pipelines.Notifications` class.
* Added `patch()` method for `workspaceClient.servingEndpoints()`
service.
* Added `tags` field for
`com.databricks.sdk.service.serving.CreateServingEndpoint`.
* Added `tags` field for
`com.databricks.sdk.service.serving.ServingEndpoint`.
* Added `tags` field for
`com.databricks.sdk.service.serving.ServingEndpointDetailed`.
 * Added `com.databricks.sdk.service.serving.DataframeSplitInput` class.
 * Added `com.databricks.sdk.service.serving.EndpointTag` class.
* Added `com.databricks.sdk.service.serving.PatchServingEndpointTags`
class.
 * Added `com.databricks.sdk.service.serving.QueryEndpointInput` class.
 * Added `workspaceClient.credentialsManager()` service.
 * Added `workspaceClient.settings()` service.
* Added `com.databricks.sdk.service.settings.DefaultNamespaceSetting`
class.
* Added
`com.databricks.sdk.service.settings.DeleteDefaultWorkspaceNamespaceRequest`
class.
* Added
`com.databricks.sdk.service.settings.DeleteDefaultWorkspaceNamespaceResponse`
class.
 * Added `com.databricks.sdk.service.settings.ExchangeToken` class.
* Added `com.databricks.sdk.service.settings.ExchangeTokenRequest`
class.
* Added `com.databricks.sdk.service.settings.ExchangeTokenResponse`
class.
 * Added `com.databricks.sdk.service.settings.PartitionId` class.
* Added
`com.databricks.sdk.service.settings.ReadDefaultWorkspaceNamespaceRequest`
class.
 * Added `com.databricks.sdk.service.settings.StringMessage` class.
 * Added `com.databricks.sdk.service.settings.TokenType` class.
* Added
`com.databricks.sdk.service.settings.UpdateDefaultWorkspaceNamespaceRequest`
class.
* Added `nextPageToken` field for
`com.databricks.sdk.service.sharing.ListCleanRoomsResponse`.
* Added `com.databricks.sdk.service.sharing.ListCleanRoomsRequest`
class.
* Added `emptyResultState` field for
`com.databricks.sdk.service.sql.AlertOptions`.
* Added `truncated` field for
`com.databricks.sdk.service.sql.ResultManifest`.
* Added `com.databricks.sdk.service.sql.AlertOptionsEmptyResultState`
class.

OpenAPI SHA: bcbf6e851e3d82fd910940910dd31c10c059746c, Date: 2023-10-02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants