dhis2: Add paging examples and default async:false in tracker.import#1681
dhis2: Add paging examples and default async:false in tracker.import#1681hunterachieng wants to merge 14 commits into
async:false in tracker.import#1681Conversation
Signed-off-by: Hunter Achieng <achienghunter@gmail.com>
Signed-off-by: Hunter Achieng <achienghunter@gmail.com>
Signed-off-by: Hunter Achieng <achienghunter@gmail.com>
async to falseasync:false in tracker.import
mtuchi
left a comment
There was a problem hiding this comment.
Hey @hunterachieng i have made couple of changes for dhis2 pagination
- I removed the
async:fasleintracker.export. After looking into dhis2 docs there is noasyncfortracker.exportonly intracker.import - I have added integration tests for pagination using
tracker.export - update
tracker.exportto include paging examples and jsdocs - update tracker unit tests to test
asyncmode fortracker.importand paging params fortracker.export
Please have a look and let me know if you have any feedback, If not we can request review from joe
|
@hunterachieng One more thing i have added dhis2 |
|
Hey @josephjclark i have added examples on docs as well and request your review OpenFn/docs#797 |
Signed-off-by: Hunter Achieng <achienghunter@gmail.com>
| * @param {string} path - Path to the resource, relative to the /tracker endpoint | ||
| * @param {object} query - An object of query parameters to be encoded into the URL | ||
| * @param {object} query - An object of query parameters to be encoded into the URL. Can include [pagination parameters](https://docs.dhis2.org/en/develop/using-the-api/dhis-core-version-master/tracker.html#request-parameters-for-pagination), filters, etc. | ||
| * @param {string} [query.order] - Comma-separated field:sortDirection pairs, e.g. `createdAt:desc` |
There was a problem hiding this comment.
This is the only query property we're actually documenting now. Why is this one so important?
There was a problem hiding this comment.
I must have missed it. i removed it
|
@hunterachieng can you update the PR description so that it's accurate? We seem to have now removed most of the things this PR actually added 😅 So I'm a little unsure about the value or point of it.
I basically just want to be sure that the PR description and changeset are accurate, and that we haven't lost sight of what this PR is supposed to be about. |
Signed-off-by: Hunter Achieng <achienghunter@gmail.com>
There was a problem hiding this comment.
@hunterachieng See joe's comment here #1681 (comment)
|
@mtuchi what do you make of all this? I just have this weird feeling that this PR doesn't actually do anything? I think the idea was to add examples but the examples we have are very thin now. Are they really telling the right story? Is this example really all we need? If so, fine :) Even the |
|
@josephjclark The only things we have added are links for pagination and the thin examples of how its done. Since pagination is not handled by us, the best we can do is with the examples and doc links. For |
|
@josephjclark
I am totally fine moving the pagination stuff into our job library docs which is what this pr on docs is doing OpenFn/docs#797 But i would be very cautious on advocating for |
|
I did some test on app to compare paging with query param
|
|
Still getting a lost run when using |
|
Ok- so those lost runs are probably occuring because we're downloading too much data and kubernetes is killing the process. The worker should really be robust to this but we know there are problems in that area. So Doing manual paging in a workflow is very very hard, but possible. Adding a better pagination API to dhis2 is possible of course. We closed down that PR on the grounds that a) it wasn't immediately needed and b) we can achieve the same thin through There's also a c): I worry that, the way the closed pagination API works, it is still in danger of downloading too much data into a single run and causing memory problems. What we really need there (and on other adaptors) is to start introducing paging APIs which allow users to process a single page of a data at a time - rather than just downloading everything in one go. That can still cause problems but at least it gives us some options. Anyway that's another story. Pagination is complicated. So we all agree that this PR doesn't do much, but the extra bit of documentation it adds is probably worthwhile? But we need to do further and deeper work to paginate and safely process very large data sets (this problem is more than just pagination) |
|
I totally agree pagination is really hard 😮💨, The api we have are so easy to footgun yourself. We definitely need some deeper work on that area But I still think these two points still need to be addressed
And this pr already address those two points. Documentation does help but for now in think the job library pr is the best place for it because we have more room to say how to handle pagination in dhis2. |
Summary
Default
async:falseintracker.importand add paging examples totracker.export()Fixes #1546
Related
Details
async:falseintracker.importfunctiontracker.exportfunctiontracker.exportpaginationtracker.import(testing async modes), andtracker.exporttesting pagination paramsAI Usage
Please disclose how you've used AI in this work (it's cool, we just want to
know!):
You can read more details in our
Responsible AI Policy
Review Checklist
Before merging, the reviewer should check the following items:
production? Is it safe to release?
dev only changes don't need a changeset.