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

[Internal] Update Jobs list function to support paginated responses #896

Merged
merged 3 commits into from
Feb 21, 2025

Conversation

hectorcast-db
Copy link
Contributor

@hectorcast-db hectorcast-db commented Feb 21, 2025

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.

Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/sdk-py

Inputs:

  • PR number: 896
  • Commit SHA: a18a76af5e4dfafd978fdaae7f20ab2ef8b2cba5

Checks will be approved automatically on success.

@hectorcast-db hectorcast-db added this pull request to the merge queue Feb 21, 2025
Merged via the queue into main with commit 3d3752a Feb 21, 2025
20 of 21 checks passed
@hectorcast-db hectorcast-db deleted the hectorcast-db/JOBS-22489-listjobs-pagination branch February 21, 2025 15:26
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.

3 participants