Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Stop serving economy results cached with ×100 decile relative changes

Abierto
#4,025 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

@anth-volk ya está trabajando en esto.

Desde el 22/10/2026.

  • #4026 de @anth-volk — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
python, redis
Área
backend, database

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

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de PolicyEngine/policyengine-api

Todos los issues de PolicyEngine/policyengine-api

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.