Skip to content

Commit

Permalink
Fix population age cast
Browse files Browse the repository at this point in the history
  • Loading branch information
b-j-mills committed Feb 24, 2025
1 parent cd34fa8 commit 80a9afe
Show file tree
Hide file tree
Showing 3 changed files with 12,192 additions and 12,196 deletions.
10 changes: 3 additions & 7 deletions src/hapi/pipelines/database/population.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,13 @@ class Population(HapiDatasetUploader):
def populate_row(self, output_row: Dict, row: Dict) -> None:
output_row["gender"] = row["gender"]
output_row["age_range"] = row["age_range"]
output_row["min_age"] = (
int(float(row["min_age"])) if row["min_age"] else None
)
output_row["max_age"] = (
int(float(row["max_age"])) if row["max_age"] else None
)
output_row["min_age"] = row["min_age"] and int(row["min_age"])
output_row["max_age"] = row["max_age"] and int(row["max_age"])
output_row["population"] = int(row["population"])

def populate(self) -> None:
self.hapi_populate(
"population",
DBPopulation,
end_resource=2,
end_resource=None,
)
Loading

0 comments on commit 80a9afe

Please sign in to comment.