Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Stop serving economy results cached with ×100 decile relative changes

オープン
#4,025 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

@anth-volk がすでに取り組んでいます。

2026年10月22日 から。

  • #4026 @anth-volk による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python, redis
領域
backend, database

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
18
フォーク
33
平均マージ
2日 18時間
マージ済み PR(30日)
36

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PolicyEngine/policyengine-api のほかの issue

PolicyEngine/policyengine-api の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。