Stop serving economy results cached with ×100 decile relative changes
I maintainer di solito rispondono entro 3 giorni
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 45/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 18
- Fork
- 33
- Merge medio
- 2g 18h
- PR unite (30g)
- 36
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PolicyEngine/policyengine-api
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
PolicyEngine/policyengine-api#3911 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
PolicyEngine/policyengine-api#3910 ·
I maintainer di solito rispondono entro 3 giorni
-
Store the metadata v3 reads in the v2 catalog, from PolicyEngine.py's public recordsForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
PolicyEngine/policyengine-api#4022 ·
I maintainer di solito rispondono entro 3 giorni
-
Request UK constituency and local-authority impacts separately from the national economy resultForse già presa @anth-volk l’ha presa oggi. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
PolicyEngine/policyengine-api#4021 ·
I maintainer di solito rispondono entro 3 giorni
-
Publish v2 catalog regions from the Public API's own region reference filesForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
PolicyEngine/policyengine-api#4019 ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di PolicyEngine/policyengine-api
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
MISP/misp-workbench#496 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
fossasia/visdom-dev#69 ·
I maintainer di solito rispondono entro 3 giorni
-
[Bug] Parameters named like a property break to_xcal()Forse già presa @atharvasalunke1267 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
collective/icalendar#2018 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno