Stop serving economy results cached with ×100 decile relative changes
Los mantenedores suelen responder en 3 días
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 45/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 18
- Forks
- 33
- Merge medio
- 2 d 18 h
- PR fusionados (30 d)
- 36
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de PolicyEngine/policyengine-api
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
PolicyEngine/policyengine-api#3911 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
PolicyEngine/policyengine-api#3910 ·
Los mantenedores suelen responder en 3 días
-
Store the metadata v3 reads in the v2 catalog, from PolicyEngine.py's public recordsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
PolicyEngine/policyengine-api#4022 ·
Los mantenedores suelen responder en 3 días
-
Request UK constituency and local-authority impacts separately from the national economy resultPosiblemente ocupada @anth-volk la tomó hace 1 día. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
PolicyEngine/policyengine-api#4021 ·
Los mantenedores suelen responder en 3 días
-
Publish v2 catalog regions from the Public API's own region reference filesPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
PolicyEngine/policyengine-api#4019 ·
Los mantenedores suelen responder en 3 días
Todos los issues de PolicyEngine/policyengine-api
Issues similares
-
style: article/section 📝 system: cloud.rc ☁️ system: security 🔐
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
uabrc/uabrc.github.io#1262 ·
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
NCAR/miles-credit#526 ·
-
documentation
Dificultad 1/5 1-3 horas Aptitud para principiantes 76/100
conda/conda-lock#957 ·
Los mantenedores suelen responder en 1 día
-
Type: Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
aws-samples/sample-per-model-bedrock#464 ·
Los mantenedores suelen responder en 1 día