Return a 400 for economy years the simulation service's model cannot project
維護者通常 2 天內回覆
已經有一個關聯 PR 被合併了。
- #4094 來自 @anth-volk —— 已合併
評估
研究方向
Start in country.py to see how economy_options.time_period is built, then inspect the API's handling of simulation service error codes, especially the SPM input codes. Check the linked PolicyEngine/policyengine-sim-api#969 for the stable error code and message contract. Done means DATASET_YEAR_UNAVAILABLE maps to a readable 400 response and UK metadata years follow the installed model projection; preserve current behavior for unknown codes and services that omit the code.
由索引模型根據 Issue 內容生成。
描述
Problem
A society-wide (economy) request for a year the simulation service's model cannot project its dataset to returns 502, and the failure is stored and replayed for 30 days as a computation failure.
- policyengine-uk projects its UK dataset (data year 2024) only to 2032 (2030 before policyengine-uk 2.130.1). A UK request for 2033 fails in the simulation service. Its job-status endpoint returns 500, and
get_economic_impactreturns 502 with "Simulation entrypoint execution failed: Simulation failed (correlation_id=…)". Every retry returns the same stored failure. - This happened on 2026-10-15 for 2031–2035 and on 2026-10-26 for 2033–2039.
- The UK years in the country metadata (
economy_options.time_period, built incountry.py) still stop at 2030. The app reads that list.
Intended change
- The simulation service will answer such a job with 400 and the stable code
DATASET_YEAR_UNAVAILABLE(PolicyEngine/policyengine-sim-api#969). Map that code to a 400 with the service's readable message, such as "UK results are available for 2024 to 2032", in the same way as the SPM input codes. - Keep today's behaviour for unknown codes, and for a simulation service that doesn't send the code yet.
- Make the UK metadata years follow the installed policyengine-uk's projection, so the list runs to 2032 now and moves with the model.
This is the Public API part of a change that also touches the simulation service and the app.
- 主要語言
- Python
- 星號
- 18
- 分支
- 33
- 平均合併
- 2 天 13 小時
- 30 天內合併 PR
- 56
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
PolicyEngine/policyengine-api 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 76/100
PolicyEngine/policyengine-api#4037 ·
維護者通常 2 天內回覆
-
難度 1/5 1-3 小時 新手友好度 88/100
PolicyEngine/policyengine-api#3911 ·
維護者通常 2 天內回覆
-
難度 1/5 1 小時以內 新手友好度 82/100
PolicyEngine/policyengine-api#3910 ·
維護者通常 2 天內回覆
-
難度 5/5 一週以上 新手友好度 35/100
PolicyEngine/policyengine-api#4107 ·
維護者通常 2 天內回覆
-
Drop the unused x and y columns from API v2's UK area impact tables可能已有人在做 @anth-volk 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 35/100
PolicyEngine/policyengine-api#4102 ·
維護者通常 2 天內回覆
查看 PolicyEngine/policyengine-api 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
btclib-org/btclib-node#2132 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 76/100
freelawproject/juriscraper#2367 · 2 則留言 ·
維護者通常 1 天內回覆
-
infra tech-debt
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
needs-triage
難度 1/5 1 小時以內 新手友好度 78/100
gke-labs/kube-agents#4190 ·
維護者通常 1 天內回覆