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

268 bug the title 2 total values and hence the overall total values returned by the all programs endpoint needs to be corrected #269

Conversation

sandeep-ps
Copy link
Member

No description provided.

…P sub program.

This changes the Title-2 total benefit amount value and the overall total benefit amount value.
@sandeep-ps sandeep-ps self-assigned this Nov 1, 2024
@navarroc
Copy link
Contributor

navarroc commented Nov 1, 2024

Previously, each state had an entry "18-22 All Programs Total" that is no longer there, it only exists in the "total" entry, is that expected?

@navarroc navarroc requested a review from ylyangtw November 1, 2024 23:53
app/controllers/pdl.py Outdated Show resolved Hide resolved
@sandeep-ps
Copy link
Member Author

Previously, each state had an entry "18-22 All Programs Total" that is no longer there, it only exists in the "total" entry, is that expected?

Good catch. It was unintentional. I only wanted to change the final total calculation to the end. I have added it back.

@sandeep-ps
Copy link
Member Author

I'm changing this to a draft PR. I will make it ready for review very soon. I think the updated SQL query needs a fix. Sorry for the inconvenience.

@sandeep-ps sandeep-ps marked this pull request as draft November 4, 2024 16:06
@sandeep-ps sandeep-ps marked this pull request as ready for review November 4, 2024 17:37
@sandeep-ps
Copy link
Member Author

The latest version from this PR (#269) is deployed to the development instance. I have verified that the sum of individual title amounts and sum of individual year amounts matches the overall total. Please review this soon, and we can proceed with the release soon after. Thanks.

{
        "State": "Total",
        "Title I 2018": 3463017591.56,
        "Title I 2019": 6970092497.43,
        "Title I 2020": 2895454170.33,
        "Title I 2021": 2379598990.19,
        "Title I 2022": 1453376648.6,
        "Title I Total": 17161539898.11,
        "Title II 2018": 4008178074.0,
        "Title II 2019": 3557721478.0,
        "Title II 2020": 3646689472.0,
        "Title II 2021": 3631991797.0,
        "Title II 2022": 3957851396.0,
        "Title II Total": 18802432217.0,
        "Crop Insurance 2018": 3436106920.0,
        "Crop Insurance 2019": 6696126194.0,
        "Crop Insurance 2020": 4842415740.0,
        "Crop Insurance 2021": 4306784988.0,
        "Crop Insurance 2022": 12490988351.0,
        "Crop Insurance Total": 31772422193.0,
        "SNAP 2018": 60722167205.0,
        "SNAP 2019": 55477097393.0,
        "SNAP 2020": 74006584807.0,
        "SNAP 2021": 108372237365.0,
        "SNAP 2022": 113621973182.0,
        "SNAP Total": 412200059952.0,
        "2018 All Programs Total": 71629469790.56,
        "2019 All Programs Total": 72701037562.43,
        "2020 All Programs Total": 85391144189.33,
        "2021 All Programs Total": 118690613140.19,
        "2022 All Programs Total": 131524189577.6,
        "18-22 All Programs Total": 479936454260.11
    }

@navarroc
Copy link
Contributor

navarroc commented Nov 4, 2024

Looks good to me and matches what I see locally. Good work!

Copy link
Contributor

@ylyangtw ylyangtw left a comment

Choose a reason for hiding this comment

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

changes look good to me!

@sandeep-ps
Copy link
Member Author

Thanks for the reviews. I will merge this PR now.

@sandeep-ps sandeep-ps merged commit 128f33b into release-0.19.0 Nov 5, 2024
1 check passed
@sandeep-ps sandeep-ps deleted the 268-bug-the-title-2-total-values-and-hence-the-overall-total-values-returned-by-the-all-programs-endpoint-needs-to-be-corrected branch November 5, 2024 15:32
sandeep-ps added a commit that referenced this pull request Nov 14, 2024
* Release 0.19.0

* 268 bug the title 2 total values and hence the overall total values returned by the all programs endpoint needs to be corrected (#269)

* When calculating total benefit payment, in CRP, include only Total CRP sub program.
This changes the Title-2 total benefit amount value and the overall total benefit amount value.

* Update CHANGELOG.

* Update README with detail on total payment amount calculation.

* Add total for year range to state JSON object.

* Use start and end years to calculate key and minor changes to comments.

* Fix SQL query for total payment calculation by including Title-1 sub programs.

* Simplify the SQL queries.

---------

Co-authored-by: YONG WOOK KIM <ywkim312@users.noreply.github.com>
sandeep-ps added a commit that referenced this pull request Nov 26, 2024
* 268 bug the title 2 total values and hence the overall total values returned by the all programs endpoint needs to be corrected (#269)

* When calculating total benefit payment, in CRP, include only Total CRP sub program.
This changes the Title-2 total benefit amount value and the overall total benefit amount value.

* Update CHANGELOG.

* Update README with detail on total payment amount calculation.

* Add total for year range to state JSON object.

* Use start and end years to calculate key and minor changes to comments.

* Fix SQL query for total payment calculation by including Title-1 sub programs.

* Simplify the SQL queries.

* Prep for release 0.20.0 (#282)

* Update CHANGELOG.

* Update version numbers.

---------

Co-authored-by: YONG WOOK KIM <ywkim312@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants