From 81aec4f2f1c85205df102302c22b07d471ce74ca Mon Sep 17 00:00:00 2001 From: Kirk Barden Date: Fri, 13 Sep 2019 17:22:24 -0400 Subject: [PATCH] correct delete indicator issue --- .../management/commands/populate_monthly_delta_files.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usaspending_api/download/management/commands/populate_monthly_delta_files.py b/usaspending_api/download/management/commands/populate_monthly_delta_files.py index 8ae71e49c9..bfa495487f 100644 --- a/usaspending_api/download/management/commands/populate_monthly_delta_files.py +++ b/usaspending_api/download/management/commands/populate_monthly_delta_files.py @@ -263,7 +263,9 @@ def add_deletion_records(self, source_path, working_dir, award_type, agency_code def organize_deletion_columns(self, source, dataframe, award_type, match_date): """ Ensure that the dataframe has all necessary columns in the correct order """ - ordered_columns = ["correction_delete_ind"] + source.columns(None) + ordered_columns = source.columns(None) + if "correction_delete_ind" not in ordered_columns: + ordered_columns = ["correction_delete_ind"] + ordered_columns # Loop through columns and populate rows for each unique_values_map = {"correction_delete_ind": "D", "last_modified_date": match_date}