Skip to content

Commit

Permalink
🔨 use categoricals instead of string for GHE (#3604)
Browse files Browse the repository at this point in the history
* 🔨 use categoricals instead of string for GHE
  • Loading branch information
Marigold authored Nov 25, 2024
1 parent 4d4fb05 commit ee7acda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions etl/steps/data/garden/who/2024-07-30/ghe.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
def run(dest_dir: str) -> None:
# read dataset from meadow
ds_meadow = paths.load_dataset()
tb = ds_meadow.read("ghe")
tb = ds_meadow.read("ghe", safe_types=False)
tb = tb.drop(columns="flag_level")

tb = rename_table_for_compatibility(tb)
Expand Down Expand Up @@ -114,7 +114,7 @@ def run(dest_dir: str) -> None:

def rename_table_for_compatibility(tb: Table) -> Table:
"""Rename columns and labels to be compatible with the previous version of the dataset."""
tb.age_group = tb.age_group.map(AGE_GROUPS_MAP)
tb.age_group = dataframes.map_series(tb.age_group, AGE_GROUPS_MAP)
tb = tb.rename(
columns={
"val_dths_count_numeric": "death_count",
Expand Down
4 changes: 2 additions & 2 deletions lib/datautils/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ee7acda

Please sign in to comment.