Skip to content

Dereferencing a resolver that returns "???" #762

@Jasha10

Description

@Jasha10

Describe the bug
Normally, trying to access a missing literal "???" results in an error.
When a custom resolver returns "???", the missing literal can be accessed without throwing an error.

To Reproduce

>>> from omegaconf import OmegaConf
>>> OmegaConf.register_new_resolver("baz", lambda: "???")
>>> cfg = OmegaConf.create({"bar": "${baz:}"})
>>> print(cfg)
{'bar': '${baz:}'}
>>> print(cfg.bar)
???

Expected behavior
I would expect that accessing cfg.bar raises a MissingMandatoryValue or an InterpolationToMissingValueError instead of printing the string "???".

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions