Fix bug in the score generation due to column clash with use of v1.0 score

This commit is contained in:
Carlos Felix 2024-12-04 14:24:25 -05:00 committed by Carlos Felix
parent e0bb33211a
commit 4130c46aee

View file

@ -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: