Dotted keys read from YAML are lost with box_dots / default_box
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
Research direction
Start by reproducing the ordering-dependent examples with Box.from_yaml using box_dots=True and default_box=True. Inspect the YAML-loading and dotted-key handling paths; done means both key orders retain a.b as nested a.b, with regression coverage for the reported inputs.
Written by the indexing model from the issue text.
Description
When reading the following YAML file...
a.b: c
a:
d: e
... with box_dots=True and default_box=True, the key a.b is lost when it's in front of a:
>>> import box
>>> box.Box.from_yaml(filename='test.yml')
Box({'a.b': 'c', 'a': {'d': 'e'}})
>>> box.Box.from_yaml(filename='test.yml',box_dots=True,default_box=True)
Box({'a': {'d': 'e'}})
Having the keys in reverse works correctly:
>>> box.Box.from_yaml(filename='test_reverse.yml')
Box({'a': {'d': 'e'}, 'a.b': 'c'})
>>> box.Box.from_yaml(filename='test_reverse.yml',box_dots=True,default_box=True)
Box({'a': {'d': 'e', 'b': 'c'}})
- Dominant language
- Python
- Stars
- 2.8k
- Forks
- 138
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cdgriffith/Box
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
cdgriffith/Box#308 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
cdgriffith/Box#307 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 30/100
cdgriffith/Box#300 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
cdgriffith/Box#298 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
cdgriffith/Box#296 · 1 reaction ·
Similar issues
-
upstream update
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
conan-io/conan-center-index#31098 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
john-kurkowski/tldextract#382 ·
-
comp/tools duplicate P2 sweeper:risk-compatibility tool/mcp type/bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
NousResearch/hermes-agent#132042 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
deepset-ai/haystack#13092 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
feder-cr/invisible_playwright_mcp#1408 ·
Maintainers usually reply within 1 day