[Bug] Camel killer box and box dots gives unexpected behaviour
评估
调研方向
首先复现使用 Box({"someKey": ["a"]}, camel_killer_box=True, box_dots=True) 展示的五次访问,比较 snake_case、camelCase 和首字母大写键的结果。确定每次查找的预期行为,然后为达成一致的行为添加回归覆盖,并验证不一致的 BoxKeyError 情况已得到解决。
由索引模型根据 Issue 内容生成。
描述
Hello! Thank you for this awesome package. The combination of camel killer box and box dots does exactly what I'm looking for. Well, almost - there's a couple of behaviours that are not working quite as I expected. I'm not sure how many of these are bugs or just my expectations are wrong but hopefully you can explain!
from box import Box
b = Box({"someKey": ["a"]}, camel_killer_box=True, box_dots=True)
b["some_key"]
# works as expected: BoxList(['a'])
b["some_key[0]"]
# works as expected: 'a'
b["someKey"]
# works but I don't know if it should? From the docs it sounds like the original camel-case
# version should have been destroyed completely, but this gives BoxList(['a'])
b["someKey[0]"]
# raises BoxKeyError - not sure whether this should work, but given that just "someKey" worked above
# it feels inconsistent at any rate
b["SomeKey"]
# works but I wouldn't expect it to! Is this meant to work?
- 主要语言
- Python
- 星标
- 2.8k
- 派生
- 144
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cdgriffith/Box 的其他 Issue
-
subclass of `Box` does not unpickle correctly可能已有人在做 @koriyoshi2041 于 152 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
cdgriffith/Box#308 ·
-
难度 3/5 1-2 天 新手友好度 42/100
cdgriffith/Box#307 · 1 条评论 ·
-
Dotted keys read from YAML are lost with box_dots / default_box可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 3/5 1-2 天 新手友好度 48/100
cdgriffith/Box#305 ·
-
难度 3/5 1-2 天 新手友好度 42/100
cdgriffith/Box#298 ·
-
难度 5/5 一周以上 新手友好度 25/100
cdgriffith/Box#296 · 1 个 reaction ·
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
microsoft/agent-lightning#661 ·
维护者通常 2 天内回复
-
area/profiles comp/cli P3 type/feature
难度 2/5 1-3 小时 新手友好度 74/100
NousResearch/hermes-agent#146372 ·
维护者通常 1 天内回复
-
[BUG] OpenAI-compatible embedding model alias breaks embedder construction可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
[oblt-aw][autodoc] Document obs-aw-automerge contract and fix automerge doc inconsistencies可能已有人在做 @github-actions 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
GeoSeries scale and skew tests fail with pytest 9.2.0可能已有人在做 @jiayuasu 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复