Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Return a 400 for economy years the simulation service's model cannot project

未关闭
#4,093 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

@anth-volk 已经在做这个了。

开始于 2026年10月27日。

  • #4094 来自 @anth-volk —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
python
领域
api

调研方向

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_impact returns 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 in country.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 天 16 小时
30 天内合并 PR
53

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PolicyEngine/policyengine-api 的其他 Issue

查看 PolicyEngine/policyengine-api 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。