Stop serving economy results cached with ×100 decile relative changes
Maintainer thường phản hồi trong vòng 3 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Read policyengine_api/constants.py and inspect RUNTIME_CACHE_SCHEMA_VERSIONS["economy_impact"] and get_economy_impact_cache_version. Confirm that simulation API PR #904 has been merged and deployed to the Public API's simulation app before changing the version from 3 to 4. Done means economy and budget-window cache lookups use the new version and recompute existing cached results.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What's wrong
Since the simulation API moved to .py 4.x, it has returned decile.relative, and for the UK wealth_decile.relative, as percentages (multiplied by 100) instead of fractions. Production economy results have carried these values since 2026-06-29, when the Public API started requesting .py 4.18.3. The simulation API bug is PolicyEngine/policyengine-sim-api#827, and its fix, which divides these values by 100 when the decile output is built, is PolicyEngine/policyengine-sim-api#904.
Why the Public API also needs a change
The Public API caches economy results in Redis for 30 days. A later request finds a cached result by its scope (country, policy pair, region, dataset and period), the economy cache version, and the options hash. None of these change when only the simulation API's code changes. So once #904 is deployed, results already cached for the current .py version (6.7.5) would keep being served with the multiplied-by-100 values until they expire.
What to change
Raise RUNTIME_CACHE_SCHEMA_VERSIONS["economy_impact"] in policyengine_api/constants.py from 3 to 4. get_economy_impact_cache_version builds the economy cache version from it, so lookups stop finding results stored under version 3 and those results are recomputed. The budget-window cache key uses the same version, so budget-window results are recomputed too.
The change should be merged only after PolicyEngine/policyengine-sim-api#904 is merged and deployed to the simulation app the Public API uses (policyengine-simulation-py6-7-5 today). Merging earlier would recompute results that still carry the multiplied-by-100 values.
Not covered
Report outputs already saved to v1 report records keep the multiplied-by-100 values. Correcting them needs a separate follow-up.
- Ngôn ngữ chính
- Python
- Star
- 18
- Fork
- 33
- Merge trung bình
- 2 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 36
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của PolicyEngine/policyengine-api
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
PolicyEngine/policyengine-api#3911 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
PolicyEngine/policyengine-api#3910 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Store the metadata v3 reads in the v2 catalog, from PolicyEngine.py's public recordsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
PolicyEngine/policyengine-api#4022 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Request UK constituency and local-authority impacts separately from the national economy resultCó thể đã có người làm @anth-volk đã nhận 1 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
PolicyEngine/policyengine-api#4021 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Publish v2 catalog regions from the Public API's own region reference filesCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
PolicyEngine/policyengine-api#4019 ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của PolicyEngine/policyengine-api
Issue tương tự
-
style: article/section 📝 system: cloud.rc ☁️ system: security 🔐
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
uabrc/uabrc.github.io#1262 ·
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
NCAR/miles-credit#526 ·
-
documentation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 76/100
conda/conda-lock#957 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
aws-samples/sample-per-model-bedrock#464 ·
Maintainer thường phản hồi trong vòng 1 ngày