Define each country's years once and refuse society-wide requests for other years
メンテナーはふだん 2 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 54/100
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 18
- フォーク
- 33
- 平均マージ
- 2日 18時間
- マージ済み PR(30日)
- 105
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PolicyEngine/policyengine-api のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
PolicyEngine/policyengine-api#4037 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
PolicyEngine/policyengine-api#3911 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
PolicyEngine/policyengine-api#3910 ·
メンテナーはふだん 2 日以内に返信
-
Update PolicyEngine bundle to 6.15.0対応中かも @policyengine が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 1/100
PolicyEngine/policyengine-api#4214 ·
メンテナーはふだん 2 日以内に返信
-
Remove household_options from the country metadata対応中かも @anth-volk が今日担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
PolicyEngine/policyengine-api#4209 ·
メンテナーはふだん 2 日以内に返信
PolicyEngine/policyengine-api の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
fritzprix/libr-agent#2612 ·
メンテナーはふだん 1 日以内に返信
-
needs-triage presubmit-gate
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
gke-labs/kube-agents#5001 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
simonw/sqlite-utils#928 ·
メンテナーはふだん 3 日以内に返信
-
colorado
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
freelawproject/juriscraper#2405 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
cline/mcp-marketplace#3576 ·