Return a 400 for economy years the simulation service's model cannot project
Maintainer antworten meist innerhalb von 2 Tagen
Ein zugehöriger Pull Request wurde bereits gemerged.
- #4094 von @anth-volk — gemerged
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Start in country.py to see how economy_options.time_period is built, then inspect the API's handling of simulation service error codes, especially the SPM input codes. Check the linked PolicyEngine/policyengine-sim-api#969 for the stable error code and message contract. Done means DATASET_YEAR_UNAVAILABLE maps to a readable 400 response and UK metadata years follow the installed model projection; preserve current behavior for unknown codes and services that omit the code.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Problem
A society-wide (economy) request for a year the simulation service's model cannot project its dataset to returns 502, and the failure is stored and replayed for 30 days as a computation failure.
- policyengine-uk projects its UK dataset (data year 2024) only to 2032 (2030 before policyengine-uk 2.130.1). A UK request for 2033 fails in the simulation service. Its job-status endpoint returns 500, and
get_economic_impactreturns 502 with "Simulation entrypoint execution failed: Simulation failed (correlation_id=…)". Every retry returns the same stored failure. - This happened on 2026-10-15 for 2031–2035 and on 2026-10-26 for 2033–2039.
- The UK years in the country metadata (
economy_options.time_period, built incountry.py) still stop at 2030. The app reads that list.
Intended change
- The simulation service will answer such a job with 400 and the stable code
DATASET_YEAR_UNAVAILABLE(PolicyEngine/policyengine-sim-api#969). Map that code to a 400 with the service's readable message, such as "UK results are available for 2024 to 2032", in the same way as the SPM input codes. - Keep today's behaviour for unknown codes, and for a simulation service that doesn't send the code yet.
- Make the UK metadata years follow the installed policyengine-uk's projection, so the list runs to 2032 now and moves with the model.
This is the Public API part of a change that also touches the simulation service and the app.
- Vorherrschende Sprache
- Python
- Sterne
- 18
- Forks
- 33
- Ø Merge
- 2 T. 13 Std.
- Gemergte PRs (30 T.)
- 56
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus PolicyEngine/policyengine-api
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
PolicyEngine/policyengine-api#4037 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
PolicyEngine/policyengine-api#3911 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
PolicyEngine/policyengine-api#3910 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Serve economy reports on the v2 routes and save v2 report and simulation IDsEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
PolicyEngine/policyengine-api#4107 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Drop the unused x and y columns from API v2's UK area impact tablesEvtl. vergeben @anth-volk hat das vor 1 Tag übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 35/100
PolicyEngine/policyengine-api#4102 ·
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in PolicyEngine/policyengine-api
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
microsoft/agent-lightning#661 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
area/profiles comp/cli P3 type/feature
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
NousResearch/hermes-agent#146372 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[BUG] OpenAI-compatible embedding model alias breaks embedder constructionEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
[oblt-aw][autodoc] Document obs-aw-automerge contract and fix automerge doc inconsistenciesEvtl. vergeben @github-actions hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
-
GeoSeries scale and skew tests fail with pytest 9.2.0Evtl. vergeben @jiayuasu hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag