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

Correcting MAJORPROGRAM transformation tracking #3821

Merged
merged 5 commits into from
May 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions backend/census_historical_migration/workbooklib/federal_awards.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,20 @@ def xform_missing_major_program(audits):
for audit in audits:
major_program = string_to_string(audit.MAJORPROGRAM)
if not major_program:
new_value = "Y" if string_to_string(audit.TYPEREPORT_MP) else "N"
major_program = "Y" if string_to_string(audit.TYPEREPORT_MP) else "N"
is_empty_major_program_found = True

track_transformations(
"MAJORPROGRAM",
audit.MAJORPROGRAM,
"is_major",
new_value,
["xform_missing_major_program"],
change_records,
)
track_transformations(
"MAJORPROGRAM",
audit.MAJORPROGRAM,
"is_major",
major_program,
["xform_missing_major_program"],
change_records,
)

audit.MAJORPROGRAM = major_program

is_empty_major_program_found = True
audit.MAJORPROGRAM = new_value
# See Transformation Method Change Recording at the top of this file.
if change_records and is_empty_major_program_found:
InspectionRecord.append_federal_awards_changes(change_records)
Expand Down