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 今天认领。 未关闭
难度 4/5 3-5 天 新手友好度 18/100
PolicyEngine/policyengine-api#3937 ·
维护者通常 2 天内回复
-
Remove the unused economy comparison module可能已有人在做 @anth-volk 今天认领。 未关闭
难度 3/5 半天 新手友好度 18/100
PolicyEngine/policyengine-api#3935 ·
维护者通常 2 天内回复
-
Refactor tests, scripts and the rules tool, then select every ruff rule (ALL)可能已有人在做 @anth-volk 今天认领。 未关闭
难度 5/5 一周以上 新手友好度 15/100
PolicyEngine/policyengine-api#3931 ·
维护者通常 2 天内回复
-
Refactor the application package within ruff's complexity limits可能已有人在做 @anth-volk 今天认领。 未关闭
难度 4/5 一周以上 新手友好度 18/100
PolicyEngine/policyengine-api#3930 ·
维护者通常 2 天内回复
查看 PolicyEngine/policyengine-api 的全部 Issue
相似的 Issue
-
customer-reported question
难度 2/5 1-3 小时 新手友好度 62/100
Azure/azure-sdk-for-python#49548 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
btclib-org/btclib-wallet#409 ·
维护者通常 1 天内回复
-
Phase 2 PSA Capability & Career Profile
难度 2/5 1-3 小时 新手友好度 62/100
bcgov/digital-journeys#2310 ·
-
bug good first issue
难度 2/5 1-3 小时 新手友好度 78/100
fastmachinelearning/hls4ml#1582 ·
维护者通常 3 天内回复
-
Sort models未关闭enhancement good first issue
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复