-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deeply merge_configs #89
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, thanks for pr @Jasha10. a few little comments to address and a failing ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
almost there, couple pesky flake8
things to fix. did you enable the pre-commit
hooks with pre-commit install
?
src/maison/utils.py
Outdated
RuntimeError: A dict cannot be merged on top of a non-dict. | ||
For example, the following would fail: | ||
`deep_merge({"foo": "bar"}, {"foo": {"baz": "qux"}})` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some indentation issues here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how to fix this. I can't get flake8 to pass no matter what I do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like these two lines just need two more spaces of indentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That does the trick! Done in 510faa7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great! one final hurdle is the coverage which i think could be sorted by adding a test to cover that RuntimeError
. sorry i know this ci is quite strict
tests/unit/test_utils.py
Outdated
param( | ||
{1: 2, 2: 5}, | ||
{1: {3: 4}}, | ||
raises(RuntimeError), | ||
id="merge-dict-into-scalar", | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for adding this extra bit of coverage. how would you feel about moving this to a separate test? i think it would make the tests more readable and would also mean you don't have to import the RaisesContext
from the private _pytest
api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 681d47d.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, whoops, I misunderstood you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 72d00b3.
perfect! thanks so much @Jasha10 , great addition. will get a release done shortly |
Implement deep (recursive) merging for nested configs.
Closes #88.