Repository navigation
CDC_Mortality_UnderlyingCause_County - #2210
Open
goutamabrol wants to merge 37 commits into
Open
goutamabrol wants to merge 37 commits into
goutamabrol wants to merge 37 commits into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a new automated importer for CDC WONDER County-Level Mortality Data, including a download script, metadata, mapping files, unit tests, and validation configurations. The reviewer feedback highlights two important improvements for the download script: first, making the is_state_downloaded check more robust to ensure all intermediate years are covered rather than just the first and last; second, modifying the downloader to log errors and continue processing other states instead of immediately terminating the script with logging.fatal when a single state fails.
balit-raibot
approved these changes
Sep 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR checklist - link
Adds the
CDC_Mortality_UnderlyingCause_Countyimport understatvar_imports/us_cdc/county_mortality_underlyingCause/for CDC WONDER county-level mortality data (1999–2024).1,909,796total observations across3,098counties):D76(1,342,838rows) and stored in GCS (gs://unresolved_mcf/cdc/UnderlyingCause/county_mortality_underlyingCause/input_files/UnderlyingCauseofDeath_County_1999_2017.csv).D158,566,958rows for2018–2024).107common causes +16rare causes) across137mapped causes in the ICD-10 113 Cause List, and fully supersedes legacyUS_Texas_Diabetesacross all 12 years (2011–2022, with79.54%exact matches and97.32%agreement within±2deaths after accounting for 15 shifted county FIPS mappings in the legacy PV map, expanded to all 50 states + DC and1999–2024).download.py): Copies the frozen1999–2017CSV from GCS and automates live2018–presentD158downloads with session agreements, dynamic year discovery, 2-year/1-year query partitioning (75k-row cap), and 31-min silent backoff onHTTP 429.geoId/{CountyCode1}) in PV map with no hardcoded county lookup tables.manifest.json): Configured for Cloud Batch execution withdownload.py,stat_var_processor.py, and monthly cron.validation_config.json): Enforces zero lint errors (LINT_ERROR_COUNT), 0.1% historical deletion threshold (DELETED_RECORDS_PERCENT), rolling date freshness (SQL_VALIDATORfor the107common causes), and floor date checks for the16rare causes.18/18unit tests pass locally (download_test.py), and end-to-end Cloud Staging (datcom-import-test) completed with all validationsPASSED.Cloud Batch job (test) - link
Validation - link
CRA Report - link