Skip to content

Serialize date metadata values#3571

Merged
MaxGhenis merged 2 commits into
masterfrom
fix-metadata-date-json
May 12, 2026
Merged

Serialize date metadata values#3571
MaxGhenis merged 2 commits into
masterfrom
fix-metadata-date-json

Conversation

@MaxGhenis
Copy link
Copy Markdown
Collaborator

Summary

  • Convert date and datetime values in country metadata to ISO strings before serving metadata JSON
  • Add a unit test for date serialization in PolicyEngineCountry._json_safe

Tests

  • env -u UV_FROZEN uv run ruff format --check policyengine_api/country.py tests/unit/test_country.py
  • env -u UV_FROZEN uv run python -m py_compile policyengine_api/country.py tests/unit/test_country.py
  • env -u UV_FROZEN uv run pytest -q tests/unit/test_country.py::TestCountryJsonSafety (blocked locally: POLICYENGINE_DB_PASSWORD is required when policyengine_api.data initializes)

@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.83%. Comparing base (1fd9618) to head (e957564).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3571      +/-   ##
==========================================
+ Coverage   77.81%   77.83%   +0.01%     
==========================================
  Files          65       65              
  Lines        3877     3880       +3     
  Branches      697      698       +1     
==========================================
+ Hits         3017     3020       +3     
  Misses        683      683              
  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 MaxGhenis merged commit d86c72c into master May 12, 2026
7 checks passed
@MaxGhenis MaxGhenis deleted the fix-metadata-date-json branch May 12, 2026 12:40
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