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

Create pydantic model for the return of show operation - get: /api/jobs/{job_id} #17153

Merged
merged 17 commits into from
Dec 19, 2023

Conversation

heisner-tillman
Copy link
Contributor

This extends the work done in #16778

Summary

  • Operation now returns pydantic model

How to test the changes?

image

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

@github-actions github-actions bot added this to the 23.2 milestone Dec 8, 2023
@heisner-tillman heisner-tillman changed the title Create pydantic model for the return of the show operation - get: /api/jobs/{job_id} Create pydantic model for the return of show operation - get: /api/jobs/{job_id} Dec 8, 2023
@heisner-tillman
Copy link
Contributor Author

The API test are failing because the pydantic model - ShowJobResponse- for the show operation, does not allow the field galaxy_version to be set to None. If I allow None there the tests succeed. Is this intended?

Copy link
Contributor

@davelopez davelopez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the look of the test failures and a bit of debugging, it seems the jobs that can have the galaxy_version as None are those of imported datasets from a history archive.

Now the actual reason they don't have a galaxy_version I wasn't sure, my guess was the job information associated with the dataset that gets serialized on the export archive was missing the galaxy_version or it was ignored/skipped when importing the job information.

After some more debugging, It turned out the job's galaxy version was serialized, but not imported back.

If you add galaxy_version to the list of ATTRIBUTES here:

It should fix the test failures. Whether not including this was intentional or an oversight I don't know, but if it was an oversight the typing of the models helped us discover it :)

lib/galaxy/schema/jobs.py Outdated Show resolved Hide resolved
lib/galaxy/schema/jobs.py Outdated Show resolved Hide resolved
@mvdbeek mvdbeek modified the milestones: 23.2, 24.0 Dec 19, 2023
@mvdbeek mvdbeek merged commit 367cf12 into galaxyproject:dev Dec 19, 2023
50 of 51 checks passed
@mvdbeek
Copy link
Member

mvdbeek commented Dec 19, 2023

Thanks a lot @heisner-tillman!

Copy link

This PR was merged without a "kind/" label, please correct.

@nsoranzo nsoranzo added kind/enhancement kind/refactoring cleanup or refactoring of existing code, no functional changes labels Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/API kind/enhancement kind/refactoring cleanup or refactoring of existing code, no functional changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants