-
Notifications
You must be signed in to change notification settings - Fork 113
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
OmegaConf.select raises an exception when selecting an invalid key in some cases #678
Comments
cc @odelalleau. |
Yeah, the fix in #444 was for interpolations -- I didn't consider That being said, I'm not entirely sure this should be changed:
But if we keep it it probably shouldn't raise a I think the example below would be a stronger case to return cfg = OmegaConf.create({"x": DictConfig(None)})
OmegaConf.select(cfg, "x.y") (though, giving it more thought, I think it could also be argued that asking for a key of |
The case that made me look at this was exactly the None case (see What do you think about OmegaConf.select(cfg, "foo.bar") returning None if foo is None? |
I'm ok with it. I would indeed prefer if it was only allowed for container nodes, but if it's somehow more convenient to also allow it for ValueNodes, I won't fight against it. |
#444 fixed an assertion error but the fix is inconsistent:
Generally, the contact of OmegaConf.select is that it returns None if the field is not found.
This fix is causing inconsistent behavior:
I can see the value of raising an exception instead of returning None, but:
Adding support for it is potentially beyond the scope of fixing this bug.
The text was updated successfully, but these errors were encountered: