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

Ensure Deterministic Ordering of Local Self Government and Ward Data #1665

Merged
merged 6 commits into from
Dec 5, 2023

Conversation

Ashesh3
Copy link
Member

@Ashesh3 Ashesh3 commented Oct 9, 2023

Fixes ohcnetwork/care_fe#6735

In this PR, we have made changes to ensure that the Local Self Government (LSG) and Ward data are always processed in a deterministic order. This is achieved by sorting the data based on the 'name' and 'localbody_code' before it's inserted into the database. This ensures that regardless of the order in which the data is read from the JSON files, it will always be inserted into the database in the same order.

Additionally, we have also sorted the list of JSON files before processing them. This ensures that the files are always processed in the same order.

These changes help in maintaining consistency and predictability when dealing with LSG and Ward data and can be particularly useful in scenarios where the order of data matters.

@coronasafe/care-backend-maintainers @coronasafe/care-backend-admins

@codecov
Copy link

codecov bot commented Oct 9, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (8bdbb42) 60.76% compared to head (2025db5) 60.75%.

Files Patch % Lines
care/users/management/commands/load_lsg_data.py 0.00% 2 Missing ⚠️
care/users/management/commands/load_ward_data.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1665      +/-   ##
==========================================
- Coverage   60.76%   60.75%   -0.02%     
==========================================
  Files         210      210              
  Lines       11531    11533       +2     
  Branches     1642     1644       +2     
==========================================
  Hits         7007     7007              
- Misses       4283     4285       +2     
  Partials      241      241              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rithviknishad
Copy link
Member

@sainak need review

@Ashesh3
Copy link
Member Author

Ashesh3 commented Dec 3, 2023

@vigneshhari could you review this?

@vigneshhari vigneshhari merged commit 033d085 into master Dec 5, 2023
9 of 11 checks passed
@vigneshhari vigneshhari deleted the loaddata-fix branch December 5, 2023 08:12
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.

Facility Local Body in Dummy data is wrongly populated
4 participants