Skip to content

Migrate my_friend_ben fixture off removed medical_out_of_pocket_expenses#1493

Merged
hua7450 merged 1 commit into
mainfrom
fix/migrate-medical-out-of-pocket-expenses-fixture
May 5, 2026
Merged

Migrate my_friend_ben fixture off removed medical_out_of_pocket_expenses#1493
hua7450 merged 1 commit into
mainfrom
fix/migrate-medical-out-of-pocket-expenses-fixture

Conversation

@hua7450
Copy link
Copy Markdown
Collaborator

@hua7450 hua7450 commented May 5, 2026

Summary

Migrates the my_friend_ben customer-household integration fixture off the input variable medical_out_of_pocket_expenses, which is removed in policyengine-us 1.673.0+. Sends other_medical_expenses instead — the load-bearing replacement for non-premium medical spending.

Unblocks #1491 (the weekly policyengine-us 1.663.0 → 1.686.0 bump), whose CI currently fails because tests/integration_with_auth/test_customer_inputs.py::TestCustomerInputs::test_my_friend_ben returns HTTP 500 / VariableNotFoundError when the engine receives the removed variable.

Why the change is needed

policyengine-us PR PolicyEngine/policyengine-us#8178 ("Decompose SPM MOOP premiums") removed the umbrella medical_out_of_pocket_expenses Person variable. It was previously adds = ["health_insurance_premiums", "other_medical_expenses"] — a convenience aggregate. Each statutory program (IRS §213 itemized, SNAP, HUD, Medicaid medically-needy, PA CCW, SPM MOOP) now has its own program-specific aggregate that follows its own legal definition, all of which read other_medical_expenses (and a premium variable) directly.

The granular pieces — other_medical_expenses, health_insurance_premiums_without_medicare_part_b, over_the_counter_health_expenses — have existed since PolicyEngine/policyengine-us#4997 (September 2024), so this migration carries no semantic loss. The fixture's prior value was 0, so the substitution is exact regardless.

Partner impact

Customers (e.g., MyFriendBen) sending medical_out_of_pocket_expenses in household payloads need the same migration. A separate partner notice covers the full mapping. For most cases, the substitution is medical_out_of_pocket_expenses → other_medical_expenses; if the value also represented premiums, send health_insurance_premiums alongside.

Files

  • tests/data/customer_households/my_friend_ben.py — rename input key
  • changelog.d/migrate-medical-out-of-pocket-expenses-fixture.changed.md — fragment

Test plan

  • pytest tests/integration_with_auth/test_customer_inputs.py::TestCustomerInputs::test_my_friend_ben passes locally against policyengine-us 1.686.0 (previously failed with VariableNotFoundError)
  • All 4 customer-input integration tests pass (my_friend_ben, amplifi×2, impactica)
  • All 223 unit tests pass
  • ruff format --check clean
  • CI passes
  • After merge: rebase Weekly policyengine-us update #1491 onto main so its CI re-runs against this fix

🤖 Generated with Claude Code

policyengine-us 1.673.0 removed the umbrella `medical_out_of_pocket_expenses`
input (PR PolicyEngine/policyengine-us#8178), which decomposed it into
program-specific aggregates with separate premium and non-premium pieces.
Send `other_medical_expenses` instead, the load-bearing replacement for
non-premium medical spending used by every internal program aggregate
(itemized_medical_expenses, snap_allowable_medical_expenses,
hud_medical_expenses, medicaid_medically_needy_medical_expenses,
pa_ccw_medical_expenses, and SPM MOOP).

Without this fix, the my_friend_ben integration test fails with HTTP 500 /
VariableNotFoundError once the package is bumped past 1.672.0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hua7450 hua7450 merged commit d7fd0de into main May 5, 2026
3 checks passed
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.

1 participant