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

Behavior change: Merging a MISSING node should not change target #462

Closed
omry opened this issue Dec 17, 2020 · 1 comment · Fixed by #463
Closed

Behavior change: Merging a MISSING node should not change target #462

omry opened this issue Dec 17, 2020 · 1 comment · Fixed by #463
Labels
enhancement New feature or request
Milestone

Comments

@omry
Copy link
Owner

omry commented Dec 17, 2020

$ cat 1.py 
from omegaconf import OmegaConf

cfg1 = OmegaConf.create({"a" : 1, "b" : "???"})
cfg2 = OmegaConf.create({"a" : "???", "b" : 2})
print(OmegaConf.merge(cfg1, cfg2))

 
omry@Coronadev:~/dev/omegaconf$ python 1.py 
{'a': '???', 'b': 2}

Desired behavior is for missing fields being merged onto non-missing fields to not change them.
Desired output:

{'a': 1, 'b': 2}
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant