Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

build_parameters checks the parameter tree root instead of the parameter

未關閉 適合新手
#3,910 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 2 天內回覆

還沒有人認領這個 Issue。

評估

難度
1/5
預估耗時
1 小時以內
新手友好度
82/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
python
領域
backend

研究方向

此錯誤位於 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

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

PolicyEngine/policyengine-api 的其他 Issue

查看 PolicyEngine/policyengine-api 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。