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

OmegaConf.resolve should crash when a resolver input is missing #1131

Open
Jasha10 opened this issue Oct 11, 2023 · 0 comments
Open

OmegaConf.resolve should crash when a resolver input is missing #1131

Jasha10 opened this issue Oct 11, 2023 · 0 comments

Comments

@Jasha10
Copy link
Collaborator

Jasha10 commented Oct 11, 2023

In the following example, OmegaConf.is_missing(config, "a") is False before calling OmegaConf.resolve, and it becomes True after calling OmegaConf.resolve.

from omegaconf import OmegaConf

def no_op(x):
    pass

OmegaConf.register_new_resolver("no_op", no_op)

config = OmegaConf.create({"a": "${no_op:${b}}", "b": "???"})

assert not OmegaConf.is_missing(config, "a")

OmegaConf.resolve(config)

assert not OmegaConf.is_missing(config, "a")  # AssertionError

This violates the principle that working with a resolved config should give the same results as working with an unresolved config.
Based on @odelalleau's comment in #1130 (comment)

By the way this makes me realize there is an issue: I was expecting OmegaConf.resolve(config) to crash, but it didn't. This is annoying because after resolution OmegaConf.is_missing(config, "a") is True, while it is False before => this is definitely a discrepancy that should be looked into.

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

No branches or pull requests

1 participant