Skip to content

Harden ACA ZIP3 parsing#8724

Draft
daphnehanse11 wants to merge 2 commits into
PolicyEngine:mainfrom
daphnehanse11:codex/issue-8675-aca-zip-hardening
Draft

Harden ACA ZIP3 parsing#8724
daphnehanse11 wants to merge 2 commits into
PolicyEngine:mainfrom
daphnehanse11:codex/issue-8675-aca-zip-hardening

Conversation

@daphnehanse11

Copy link
Copy Markdown
Collaborator

Partially fixes #8675.

Summary

  • Makes three_digit_zip_code parse ZIP codes as text before deriving ZIP3.
  • Returns an empty ZIP3 for missing or nonnumeric ZIP codes instead of raising during ACA SLCSP paths.
  • Adds tests for UNKNOWN, empty, nonnumeric, ZIP+4, and leading-zero ZIP values.

Tests

  • uv run pytest policyengine_us/tests/policy/baseline/household/demographic/geographic/test_three_digit_zip_code.py
  • git diff --check

@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (47cb26b) to head (0308803).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #8724   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         1    -2     
  Lines           47        13   -34     
=========================================
- Hits            47        13   -34     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@daphnehanse11 daphnehanse11 force-pushed the codex/issue-8675-aca-zip-hardening branch from e30c6f6 to 0308803 Compare June 22, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Harden ACA SLCSP rating-area lookup for richer Populace geography

1 participant