-
Notifications
You must be signed in to change notification settings - Fork 2
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 paging to f1-j1-getPrimeroCasesV2.js
#130
Comments
@aleksa-krolls should i branch off from |
hey @mtuchi pls branch off |
Hiya @aleksa Krolls there is a potential performance implication when using getCases with the I am currently experimenting pagination with a small batch, I will share more tomorrow |
@mtuchi feel free to query in smaller batches (less than |
@josephjclark This is ready for code review now, See #131 |
@aleksa-krolls i have tested the changes locally with the FYI. The changes in #131 uses |
hey @mtuchi fyi I've asked @daissatou2 for help testing here - and then I will do a final review/merge to prod when I get back online |
@mtuchi I want to test this on the staging project but it looks like the PR was created against main. Can you please create the PR against staging? |
@daissatou2 i think we need to overwrite what is on staging right now because i did ask @aleksa-krolls which branch to use and she suggested we use |
@aleksa-krolls we tested this together locally and it passed. I created a case & referral on Primero and we ran the workflow. We did not merge the PR per Mtuchi's last comment. |
@mtuchi as discussed, pls refresh @aleksa-krolls i have refreshed |
Request
Primero API requests are now limited to a maximum of
1,000
records. While it's rare that we an API query returns more than 1,000 records, we should proactively update our OpenFn jobs to consider this limit and to handle paging if more than 1k records do exist.In the job
V2/f1-j1-getPrimeroCasesV2.js
, we need to (1) change the parameter per to one thousandper: 1000
and then (2) handle scenarios where multiple pages of data may be returnedexpression.js
Please branch off main and update the job
V2/f1-j1-getPrimeroCasesV2.js
. MAKE SURE TO ONLY UPDATE JOB IN V2 FOLDER:https://github.com/OpenFn/unicef-cambodia/blob/master/jobs/V2/f1-j1-getPrimeroCasesV2.js
Query to update:
unicef-cambodia/jobs/V2/f1-j1-getPrimeroCasesV2.js
Lines 19 to 29 in 57237db
state
Primero (to generate state):
To test
Feel free to run locally. When ready to test, pls merge to the
staging
branch so that we can test on the Staging platform project: https://www.openfn.org/projects/primero-oscar-cambodia-io-staging/jobs/jywagaToggl
UNICEF Cambodia Primero IO Support [2024]
The text was updated successfully, but these errors were encountered: