Skip to content

Ignore deprecated medical expense input#3574

Closed
MaxGhenis wants to merge 2 commits into
masterfrom
codex/medical-oop-fallback
Closed

Ignore deprecated medical expense input#3574
MaxGhenis wants to merge 2 commits into
masterfrom
codex/medical-oop-fallback

Conversation

@MaxGhenis
Copy link
Copy Markdown
Collaborator

Summary

  • Add a standard API deprecated-input scrubber for medical_out_of_pocket_expenses.
  • Strip that removed variable before household calculations reach the engine.
  • Return warning strings on successful responses when deprecated inputs are ignored.

Context

MFB falls back from household.api.policyengine.org/us/calculate to api.policyengine.org/us/calculate when household API requests time out. Household API already ignores medical_out_of_pocket_expenses and returns a warning, but the standard API fallback still returns a fast HTTP 500 for payloads containing the removed field.

This applies the same graceful behavior to standard API household calculations so MFB fallback requests can keep computing while they migrate to other_medical_expenses and health_insurance_premiums.

Testing

  • uv run pytest tests/test_deprecated_inputs.py -q
  • uv run ruff check policyengine_api/endpoints/household.py policyengine_api/utils/deprecated_inputs.py tests/test_deprecated_inputs.py

@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

❌ Patch coverage is 21.11111% with 71 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.58%. Comparing base (1fd9618) to head (5f2eac2).
⚠️ Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
policyengine_api/utils/deprecated_inputs.py 24.00% 57 Missing ⚠️
policyengine_api/endpoints/household.py 6.66% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3574      +/-   ##
==========================================
- Coverage   77.81%   76.58%   -1.24%     
==========================================
  Files          65       66       +1     
  Lines        3877     3968      +91     
  Branches      697      724      +27     
==========================================
+ Hits         3017     3039      +22     
- Misses        683      752      +69     
  Partials      177      177              

☔ View full report in Codecov by Sentry.
📢 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.

@MaxGhenis
Copy link
Copy Markdown
Collaborator Author

Closing in favor of #3576, which now includes the deprecated medical expense input fallback plus structured 400 responses for unrecognized calculate inputs.

@MaxGhenis MaxGhenis closed this May 14, 2026
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