Define each country's years once and refuse society-wide requests for other years
Mantenedores costumam responder em até 2 dias
Um pull request relacionado já foi integrado.
- #4212 de @anth-volk — integrado
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 54/100
Direção de pesquisa
Read policyengine_api/country.py, policyengine_api/economy_years.py, and policyengine_api/data/v2/catalog/extraction.py to trace the current year lists, then inspect the economy routes and assert_country_matches to find request validation and catalog publication behavior. Check the existing route and catalog tests before making changes. Done means the shared country year lists drive metadata and extraction, unavailable economy years return 400 with DATASET_YEAR_UNAVAILABLE before stored results or simulation calls, and publication updates only time periods while still rejecting other differences.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Problem
The maintainer decided on 4–5 November 2026 that:
- US 2022 and 2023 are dropped everywhere. Household and society-wide calculations share one list of years per country, starting in 2024 for the US.
- Each country's years are defined once, as constants in the Public API: US 2024–2035, UK 2024–2032.
- A society-wide (economy) request for a year outside its country's list is refused with a 400, including when a result for that year is already stored.
- Household calculations are not refused; only the menus stop offering those years.
Today the years are defined in three places:
/{country}/metadata'seconomy_options.time_periodfor the US is a hand-written list inpolicyengine_api/country.py, 2035 down to 2022.- The UK years come from
uk_economy_yearsinpolicyengine_api/economy_years.py, from the installed policyengine-uk's projection end. - The v2 catalog has its own copy,
METADATA_TIME_PERIODSinpolicyengine_api/data/v2/catalog/extraction.py: US 2035 to 2022, and UK 2024 to 2030, which is out of date.
The economy routes accept any four-digit year and pass it to the simulation service, and answer a stored result for it.
Catalog publication also fails when a stored catalog version's time periods (metadata_time_periods) differ from the staged ones (assert_country_matches), so changing the catalog's years would stop the next release's publication for an already-stored PolicyEngine.py version.
Change
- Define each country's years once and use them for
/{country}/metadataand catalog extraction. - Answer a society-wide request for any other year with 400 and the code
DATASET_YEAR_UNAVAILABLE, before any stored result is read or anything is sent to the simulation service. - Make catalog publication replace a stored version's time periods with the staged ones, with a log entry, instead of failing. Every other column and table keeps failing on a difference.
- Linguagem predominante
- Python
- Estrelas
- 18
- Forks
- 33
- Merge médio
- 2d 17h
- PRs com merge (30d)
- 108
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de PolicyEngine/policyengine-api
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
PolicyEngine/policyengine-api#4037 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 88/100
PolicyEngine/policyengine-api#3911 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 82/100
PolicyEngine/policyengine-api#3910 ·
Mantenedores costumam responder em até 2 dias
-
service: policyengine-stage12-uk-worker telemetry-error
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 25/100
PolicyEngine/policyengine-api#4228 ·
Mantenedores costumam responder em até 2 dias
-
service: policyengine-simulation-py telemetry-error
Dificuldade 4/5 1-2 dias Facilidade para iniciantes 30/100
PolicyEngine/policyengine-api#4227 ·
Mantenedores costumam responder em até 2 dias
Todas as issues de PolicyEngine/policyengine-api
Issues semelhantes
-
LLVM versionsAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
Mantenedores costumam responder em até 1 dia
-
Translate docs/ to SpanishAbertadocumentation good first issue language
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 91/100
-
good first issue help wanted translation
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
Mantenedores costumam responder em até 1 dia
-
Fix duplicated word in speculative decoding docsTalvez já em andamento @ddlw assumiu hoje. Abertacommunity-request
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 89/100
NVIDIA/Megatron-LM#9118 ·
Mantenedores costumam responder em até 2 dias