Skip to content

Conversation

@toph-allen
Copy link
Collaborator

Intent

Switch to using the v1 API for get_jobs().

Fixes #340

Approach

The data returned by the old unversioned endpoint and the v1 endpoint (which has been around since 2022) differs. I adjusted the ptype to match the new endpoint, which mostly processes the old data correctly. To support this, I added the following:

  • Now there is an option to use the ptype column order in parse_connectapi_typed(), to make the returned data nice and consistent looking. :)
  • Manually compute status (new) from finalized (old). We cannot fully compute status. The old finalized == FALSE corresponds to status == 0, but finalized == TRUE corresponds to statuses 1 and 2, so in that case status is NA.
  • Added a function to let vctrs cast from integer to character.

Tests added:

  • A test using httptest, which uses real responses captured from the old and new endpoints for the same piece of content. Checks that common columns are identical, and manually checks the status column for each.

Checklist

  • Does this change update NEWS.md (referencing the connected issue if necessary)? NEED
  • Does this change need documentation? Have you run devtools::document()?

Copy link
Collaborator

@schloerke schloerke left a comment

Choose a reason for hiding this comment

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

NEWS entry worthy?

Two small things, then good to merge!

toph-allen and others added 3 commits December 5, 2024 15:34
Co-authored-by: Barret Schloerke <[email protected]>
Co-authored-by: Barret Schloerke <[email protected]>
@toph-allen toph-allen merged commit 73e8545 into main Dec 5, 2024
19 checks passed
@toph-allen toph-allen deleted the toph/get-jobs-v1 branch December 5, 2024 20:52
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.

Migrate get_jobs() to v1 API

3 participants