Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a review branch of the d2d development.
Files to focus the review:
-extract.py
-push.py
-data_models.py
-Related tests.
Main changes on extract and push functionalities:
-Refactored to use polars instead of pandas
-Logging in extract and push uses a generic function from utils.
-DHIS2Extractor format the extracts following DHIS2 naming.
-DHIS2Pusher class expects an extract with DHIS2 naming (extract -> push).
-Push class classifies datapoints based on polars filtering on hard rules (faster).
-Serialization (import and remove payload) handled in the DataPointModel Class definition (data_models.py)
-Testing basic functionalities for : DHIS2Extractor , DHIS2Pusher and DataPointModel.
Next steps and ideas (No need to review these files):
-DHIS2Extractor uses three separate classes to handle data elements, reporting rates, and indicators. I've created a branch with an alternative approach that uses DHIS2's standard API endpoints (dataValueSets & Analytics) instead. This aligns better with DHIS2's architecture, but requires users to provide additional parameters when using Analytics data.
-OrgUnitModel class (data_models.py): needs a simplification.
-DHIS2Pusher class should be able to push OrgUnits for creation and update, so the org_unit_aligner can make use of it.
-DHIS2PyramidAligner (org_unit_aligner.py): Util class to handle the creation and update of DHIS2 pyramid (..implement DHIS2Pusher).
-DatasetCompletionSync (dataset_completion.py): Util class to retrieve and push dataset reporting statuses. Very slow as DHIS2 API does not allow updates in bulk. Needs a review.