DictConfig/ListConfig.get/pop()
should not fall back to default value on interpolation errors
#565
Milestone
DictConfig/ListConfig.get/pop()
should not fall back to default value on interpolation errors
#565
Is your feature request related to a problem? Please describe.
Currently, calling
cfg.get(key, default_value)
orcfg.pop(key, default_value)
wherecfg
is either a DictConfig or a ListConfig will returndefault_value
ifkey
is an interpolation whose resolution fails (e.g., to a non-existing node, or a non-existing custom resolver). This can be dangerous as it may hide errors.Describe the solution you'd like
If
key
exists and is an interpolation,get()
andpop()
should either return the resolved value (if possible), or raise an exception (if the interpolation can't be resolved).In addition,
OmegaConf.select()
should be modified to be consistent with this new behavior, i.e., callingOmegaConf.select(cfg, key, default=val)
should not return the default value ifkey
is an interpolation to a non-existing node.Additional context
Fixed in #545. Creating this issue to keep track of changes.
The text was updated successfully, but these errors were encountered: