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 天 7 小時
30 天內合併 PR
64

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

PolicyEngine/policyengine-api 的其他 Issue

查看 PolicyEngine/policyengine-api 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。