Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Error merging into a config with a read only node even if not changing that node. #271

Closed
omry opened this issue Jun 19, 2020 · 0 comments · Fixed by #272
Closed

Error merging into a config with a read only node even if not changing that node. #271

omry opened this issue Jun 19, 2020 · 0 comments · Fixed by #272
Labels
bug Something isn't working

Comments

@omry
Copy link
Owner

omry commented Jun 19, 2020

This should work:

cfg1 = OmegaConf.create({"foo": {"bar": 10}})
cfg2 = OmegaConf.create({"foo": {}})
OmegaConf.set_readonly(cfg1, True)
cfg1.merge_with(cfg2)

and so should this:

cfg1 = OmegaConf.create({"foo": {"bar": 10}})
cfg2 = OmegaConf.create({"xyz": 10})
OmegaConf.set_readonly(cfg1.foo, True)
cfg1.merge_with(cfg2)
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant