Skip to content
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

Error when merging MISSING list on top of an existing list #305

Closed
omry opened this issue Jul 16, 2020 · 0 comments · Fixed by #306
Closed

Error when merging MISSING list on top of an existing list #305

omry opened this issue Jul 16, 2020 · 0 comments · Fixed by #306

Comments

@omry
Copy link
Owner

omry commented Jul 16, 2020

Better behavior is to make the target list missing.

In [1]: from omegaconf import ListConfig, OmegaConf
In [2]: l1 = ListConfig([1,2,3])
In [3]: l2 = ListConfig("???")
In [4]: OmegaConf.merge(l1, l2) 
...
MissingMandatoryValue: Cannot iterate a missing ListConfig
        full_key: 
        reference_type=Optional[List[Any]]
        object_type=list

desired:

In [1]: from omegaconf import ListConfig, OmegaConf
In [2]: l1 = ListConfig([1,2,3])
In [3]: l2 = ListConfig("???")
In [4]: OmegaConf.merge(l1, l2)
Out[4]: '???'  # <- this is a ListConfig, not a string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant