Skip to content

Feature: throw_on_missing keyword argument for OmegaConf.to_container #501

@Jasha10

Description

@Jasha10

Feature:

Currently, calling OmegaConf.to_container(cfg) can result in a python object that contains some "???" MISSING strings.

I propose to add a throw_on_missing keyword argument to OmegaConf.to_container, so that the structure returned by OmegaConf.to_container(cfg, throw_on_missing=True) will raise omegaconf.MissingMandatoryValue if any missing values are encountered.

This way, if no MissingMandatorValue is raised, clients can be assured that the result of to_container does not contain any "???" strings.

To maintain backward compatibility, the default would be throw_on_missing=False.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions