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

Document UK breakdown results' withheld area codes, and stop serving breakdowns cached without them

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

维护者通常 2 天内回复

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

开始于 2026年10月28日。

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

评估

难度
4/5
预计耗时
3-5 天
新手友好度
43/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
openapi, python

调研方向

Read the completed breakdown result description around line 887 in openapi_spec.yaml and inspect _breakdown_result_kind_error in services/economy_impact_execution.py. Find the options hash and its schema version handling, then check the contract tests for breakdown results. Done means the OpenAPI description documents withheld codes and older breakdown cache entries are bypassed while national result cache entries remain unaffected.

由索引模型根据 Issue 内容生成。

描述

Problem

The simulation API will return, for each level of a UK local-area breakdown, the ONS codes of the areas disclosure control withheld (https://github.com/PolicyEngine/policyengine-sim-api/issues/968). The Public API already stores and returns a breakdown result unchanged once its kind is local_areas (_breakdown_result_kind_error in services/economy_impact_execution.py), so the new fields will pass through. Two things still need doing.

  1. Documentation. The OpenAPI description of the annual economy route's completed breakdown result (openapi_spec.yaml, about line 887) lists kind, the two area lists and the dataset and version fields. It should also describe the withheld codes, and that they are absent from results computed before the simulation API reported them.
  2. Cached results. Breakdown results cached before the change stay cached for up to 30 days without the new fields. A simulation API deploy that keeps the same .py version doesn't change the cache key, so clients would get the list for existing reports only once those entries expire. Bumping RUNTIME_CACHE_SCHEMA_VERSIONS["economy_impact"] would recompute every cached economy result, not just breakdowns. Instead, give breakdown requests their own schema version in the options hash, so that only breakdown results computed before the change are recomputed on the next request.

Done when

  • The OpenAPI description covers the withheld codes.
  • A contract test shows a breakdown result with the withheld codes is stored and returned unchanged.
  • Breakdown results cached before the change are not served, and national results' cache entries are unaffected.

Notes

  • Order: merge after the simulation API change is deployed.
  • Related: the app will hatch only the listed codes as "Not reported" and show any other absent area as "No data" (PolicyEngine/policyengine-app-v2#1448 review).
主要语言
Python
星标
18
派生
33
平均合并
2 天 13 小时
30 天内合并 PR
56

环境准备

从这里开始

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

PolicyEngine/policyengine-api 的其他 Issue

查看 PolicyEngine/policyengine-api 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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