Skip to content

Harden ACA ZIP3 parsing#8724

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

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 (f9e58e7) to head (4f67e8d).
⚠️ Report is 161 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #8724   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         1    -2     
  Lines           55        13   -42     
=========================================
- Hits            55        13   -42     
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 reopened this Jun 22, 2026
@daphnehanse11 daphnehanse11 force-pushed the codex/issue-8675-aca-zip-hardening branch from e30c6f6 to 0308803 Compare June 22, 2026 17:16
@daphnehanse11 daphnehanse11 force-pushed the codex/issue-8675-aca-zip-hardening branch from 0308803 to 4f67e8d Compare July 6, 2026 19:47
@daphnehanse11 daphnehanse11 marked this pull request as ready for review July 6, 2026 20:10
@daphnehanse11 daphnehanse11 requested a review from MaxGhenis July 6, 2026 20:10
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