build_parameters checks the parameter tree root instead of the parameter
維護者通常 2 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
此錯誤位於 policyengine_api/country.py 中的 PolicyEngineCountry.build_parameters,其最後一個 elif 檢查的是根節點上的 isinstance(parameters, ParameterNode),而不是目前的 parameter。請閱讀該函式的型別分派邏輯,確認迴圈變數名稱,然後將條件改為測試 parameter。完成的標準是:該分支測試的是後代節點,且 build_parameters 現有的測試仍然全部通過。
由索引模型根據 Issue 內容生成。
描述
In PolicyEngineCountry.build_parameters (policyengine_api/country.py), the last branch of the type dispatch is:
elif isinstance(parameters, ParameterNode):
parameters is the root tax_benefit_system.parameters, which is always a ParameterNode, so the condition is always true. The intended check is almost certainly isinstance(parameter, ParameterNode) on the current descendant.
Impact
None observed today: every descendant that reaches this branch is a ParameterNode anyway, so the output is the same. But any other descendant type would silently be described as a parameter node instead of being skipped.
Expected
Check parameter, not parameters.
Notes
Found while documenting the code for the ruff docstring rules; behaviour was left unchanged there.
- 主要語言
- Python
- 星號
- 18
- 分支
- 33
- 平均合併
- 1 天 18 小時
- 30 天內合併 PR
- 23
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
PolicyEngine/policyengine-api 的其他 Issue
-
難度 1/5 1-3 小時 新手友好度 88/100
PolicyEngine/policyengine-api#3911 ·
維護者通常 2 天內回覆
-
Register weighted-microdata rules: weights aren't values可能已有人在做 @anth-volk 於 1 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 18/100
PolicyEngine/policyengine-api#3937 ·
維護者通常 2 天內回覆
-
Remove the unused economy comparison module可能已有人在做 @anth-volk 於 1 天前認領。 未關閉
難度 3/5 半天 新手友好度 18/100
PolicyEngine/policyengine-api#3935 ·
維護者通常 2 天內回覆
-
Refactor tests, scripts and the rules tool, then select every ruff rule (ALL)可能已有人在做 @anth-volk 於 1 天前認領。 未關閉
難度 5/5 一週以上 新手友好度 15/100
PolicyEngine/policyengine-api#3931 ·
維護者通常 2 天內回覆
-
Refactor the application package within ruff's complexity limits可能已有人在做 @anth-volk 於 1 天前認領。 未關閉
難度 4/5 一週以上 新手友好度 18/100
PolicyEngine/policyengine-api#3930 ·
維護者通常 2 天內回覆
查看 PolicyEngine/policyengine-api 的全部 Issue
相似的 Issue
-
Path subtraction removes repeated suffix characters instead of one suffix可能已有人在做 @Gwerdonatus 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
joke2k/django-environ#671 ·
-
good first issue help wanted windows
難度 2/5 1-3 小時 新手友好度 80/100
-
test_pgbouncer deploys the server under test from Charmhub instead of the local build (track/1.31)未關閉bug
難度 2/5 1-3 小時 新手友好度 68/100
canonical/temporal-k8s-operator#195 · 1 則留言 ·
維護者通常 4 天內回覆
-
`burr` fails to start when the Python path has a space in it可能已有人在做 @enekoreto 今天認領。 未關閉status/needs-triage
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 5 天內回覆
-
device support request
難度 2/5 1-3 小時 新手友好度 68/100
zigpy/zha-device-handlers#5461 ·
維護者通常 4 天內回覆