-
Notifications
You must be signed in to change notification settings - Fork 154
[Internal] Update Jobs list function to support paginated responses #896
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
Merged
hectorcast-db
merged 3 commits into
main
from
hectorcast-db/JOBS-22489-listjobs-pagination
Feb 21, 2025
Merged
[Internal] Update Jobs list function to support paginated responses #896
hectorcast-db
merged 3 commits into
main
from
hectorcast-db/JOBS-22489-listjobs-pagination
Feb 21, 2025
Conversation
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
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
renaudhartert-db
approved these changes
Feb 21, 2025
deco-sdk-tagging bot
added a commit
that referenced
this pull request
Mar 6, 2025
## Release v0.45.0 ### New Features and Improvements * Update Jobs service to use API 2.2 ([#913](#913)). ### Internal Changes * Refactor `DatabricksError` to expose different types of error details ([#912](#912)). * Update Jobs ListJobs API to support paginated responses ([#896](#896)) * Update Jobs ListRuns API to support paginated responses ([#890](#890)) * Introduce automated tagging ([#888](#888)) * Update Jobs GetJob API to support paginated responses ([#869](#869)). * Update On Behalf Of User Authentication in Multithreaded applications ([#907](#907)) ### API Changes * Added `execute_message_attachment_query()`, `get_message_attachment_query_result()` and `get_space()` methods for [w.genie](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/dashboards/genie.html) workspace-level service. * Added `list_provider_share_assets()` method for [w.providers](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/sharing/providers.html) workspace-level service. * Added `budget_policy_id` and `effective_budget_policy_id` fields for `databricks.sdk.service.apps.App`. * Added `policy` field for `databricks.sdk.service.billing.CreateBudgetPolicyRequest`. * Added `databricks_gcp_service_account` field for `databricks.sdk.service.catalog.ValidateCredentialRequest`. * Added `attachment_id` field for `databricks.sdk.service.dashboards.GenieAttachment`. * Added `conversation_id` field for `databricks.sdk.service.dashboards.GenieConversation`. * Added `message_id` field for `databricks.sdk.service.dashboards.GenieMessage`. * Added `description`, `id`, `last_updated_timestamp`, `query`, `query_result_metadata` and `title` fields for `databricks.sdk.service.dashboards.GenieQueryAttachment`. * Added `gen_ai_compute_task` field for `databricks.sdk.service.jobs.RunTask`. * Added `gen_ai_compute_task` field for `databricks.sdk.service.jobs.SubmitTask`. * Added `gen_ai_compute_task` field for `databricks.sdk.service.jobs.Task`. * Added `run_name` field for `databricks.sdk.service.ml.CreateRun`. * Added `run_name` field for `databricks.sdk.service.ml.RunInfo`. * Added `run_name` field for `databricks.sdk.service.ml.UpdateRun`. * Added `lifetime` field for `databricks.sdk.service.oauth2.CreateServicePrincipalSecretRequest`. * Added `expire_time` field for `databricks.sdk.service.oauth2.CreateServicePrincipalSecretResponse`. * Added `jwks_uri` field for `databricks.sdk.service.oauth2.OidcFederationPolicy`. * Added `expire_time` field for `databricks.sdk.service.oauth2.SecretInfo`. * Added `instance_profile_arn` field for `databricks.sdk.service.serving.AmazonBedrockConfig`. * Added `budget_policy_id` field for `databricks.sdk.service.serving.CreateServingEndpoint`. * Added `budget_policy_id` field for `databricks.sdk.service.serving.ServingEndpoint`. * Added `budget_policy_id` field for `databricks.sdk.service.serving.ServingEndpointDetailed`. * Added `add`, `principal` and `remove` fields for `databricks.sdk.service.sharing.PermissionsChange`. * Added `columns_to_rerank` field for `databricks.sdk.service.vectorsearch.QueryVectorIndexRequest`. * Added `oracle` and `teradata` enum values for `databricks.sdk.service.catalog.ConnectionType`. * Added `function_arguments_invalid_type_exception` and `message_cancelled_while_executing_exception` enum values for `databricks.sdk.service.dashboards.MessageErrorType`. * Added `waiting` enum value for `databricks.sdk.service.jobs.RunLifecycleStateV2State`. * Added `active_only`, `all` and `deleted_only` enum values for `databricks.sdk.service.ml.ViewType`. * Added `oauth_client_credentials` enum value for `databricks.sdk.service.sharing.AuthenticationType`. * Added `raw` enum value for `databricks.sdk.service.workspace.ExportFormat`. * [Breaking] Changed `get_by_name()` method for [w.experiments](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/ml/experiments.html) workspace-level service to return `databricks.sdk.service.ml.GetExperimentByNameResponse` dataclass. * [Breaking] Changed `log_inputs()` method for [w.experiments](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/ml/experiments.html) workspace-level service with new required argument order. * [Breaking] Changed `share_permissions()` method for [w.shares](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/sharing/shares.html) workspace-level service to return `databricks.sdk.service.sharing.GetSharePermissionsResponse` dataclass. * [Breaking] Changed `share_permissions()` and `update_permissions()` methods for [w.shares](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/sharing/shares.html) workspace-level service return type to become non-empty. * [Breaking] Changed `update_permissions()` method for [w.shares](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/sharing/shares.html) workspace-level service to return `databricks.sdk.service.sharing.UpdateSharePermissionsResponse` dataclass. * [Breaking] Changed `policy_id` field for `databricks.sdk.service.billing.BudgetPolicy` to no longer be required. * Changed `policy_id` field for `databricks.sdk.service.billing.BudgetPolicy` to no longer be required. * [Breaking] Changed `partitions` field for `databricks.sdk.service.cleanrooms.CleanRoomAssetTableLocalDetails` to type `databricks.sdk.service.cleanrooms.PartitionList` dataclass. * [Breaking] Changed `query` field for `databricks.sdk.service.dashboards.GenieAttachment` to type `databricks.sdk.service.dashboards.GenieQueryAttachment` dataclass. * [Breaking] Changed `digest`, `name`, `source` and `source_type` fields for `databricks.sdk.service.ml.Dataset` to be required. * Changed `digest`, `name`, `source` and `source_type` fields for `databricks.sdk.service.ml.Dataset` to be required. * [Breaking] Changed `dataset` field for `databricks.sdk.service.ml.DatasetInput` to be required. * Changed `dataset` field for `databricks.sdk.service.ml.DatasetInput` to be required. * Changed `key` and `value` fields for `databricks.sdk.service.ml.InputTag` to be required. * [Breaking] Changed `key` and `value` fields for `databricks.sdk.service.ml.InputTag` to be required. * [Breaking] Changed `view_type` field for `databricks.sdk.service.ml.ListExperimentsRequest` to type `databricks.sdk.service.ml.ViewType` dataclass. * [Breaking] Changed `run_id` field for `databricks.sdk.service.ml.LogInputs` to be required. * [Breaking] Changed `view_type` field for `databricks.sdk.service.ml.SearchExperiments` to type `databricks.sdk.service.ml.ViewType` dataclass. * [Breaking] Changed `run_view_type` field for `databricks.sdk.service.ml.SearchRuns` to type `databricks.sdk.service.ml.ViewType` dataclass. * [Breaking] Removed `custom_tags` and `policy_name` fields for `databricks.sdk.service.billing.CreateBudgetPolicyRequest`. * [Breaking] Removed `cached_query_schema`, `description`, `id`, `instruction_id`, `instruction_title`, `last_updated_timestamp`, `query`, `statement_id` and `title` fields for `databricks.sdk.service.dashboards.QueryAttachment`. * [Breaking] Removed `max_results` and `page_token` fields for `databricks.sdk.service.sharing.UpdateSharePermissions`. * [Breaking] Removed `active_only`, `all` and `deleted_only` enum values for `databricks.sdk.service.ml.SearchExperimentsViewType`. * [Breaking] Removed `active_only`, `all` and `deleted_only` enum values for `databricks.sdk.service.ml.SearchRunsRunViewType`.
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.
What changes are proposed in this pull request?
Introduces logic in the extension for jobs ListJobs call. The extended logic accounts for the new response format of API 2.2. API 2.1 format returns all tasks and job_cluster for each job in the jobs list. API 2.2 format truncates tasks and job_cluster to 100 elements. The extended ListJobs logic calls GetJob for each job in the list to populate the full list of tasks and job_clusters.
The code consumes generator that is returned from
super().list
and it produces generator as well.How is this tested?
Unit tests and manual tests. Manual tests were done in two modes: using API 2.2 and using API 2.1. So this code is code is compatible with both API versions.
Notes
Copy of this other PR
#889
The formatter is inconsistent and the original author could make it work.