From 4130c46aee94b3a320935e68a3dc715afe90bfa9 Mon Sep 17 00:00:00 2001 From: Carlos Felix <63804190+carlosfelix2@users.noreply.github.com> Date: Wed, 4 Dec 2024 14:24:25 -0500 Subject: [PATCH] Fix bug in the score generation due to column clash with use of v1.0 score --- data/data-pipeline/data_pipeline/etl/score/etl_score.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/data/data-pipeline/data_pipeline/etl/score/etl_score.py b/data/data-pipeline/data_pipeline/etl/score/etl_score.py index afa03ae9..6dc13fe0 100644 --- a/data/data-pipeline/data_pipeline/etl/score/etl_score.py +++ b/data/data-pipeline/data_pipeline/etl/score/etl_score.py @@ -215,11 +215,14 @@ class ScoreETL(ExtractTransformLoad): dtype={self.GEOID_TRACT_FIELD_NAME: "string"}, low_memory=False, ) - self.v1_0_score_results_df.rename( + # Only keep the columns we need and rename them as they will clash + # with the new score DF. + self.v1_0_score_results_df = self.v1_0_score_results_df[ + [field_names.GEOID_TRACT_FIELD, field_names.FINAL_SCORE_N_BOOLEAN] + ].rename( columns={ field_names.FINAL_SCORE_N_BOOLEAN: field_names.FINAL_SCORE_N_BOOLEAN_V1_0, - }, - inplace=True, + } ) def _join_tract_dfs(self, census_tract_dfs: list) -> pd.DataFrame: