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

[bug] Nested interpolations don't work #212

Closed
apsdehal opened this issue Apr 18, 2020 · 1 comment
Closed

[bug] Nested interpolations don't work #212

apsdehal opened this issue Apr 18, 2020 · 1 comment

Comments

@apsdehal
Copy link

Nested interpolations only resolve inner level interpolations.

a = OmegaConf.create({"a": "${hello:${default_hello:}}"})
OmegaConf.register_resolver("hello", lambda x: x)
OmegaConf.register_resolver("default_hello", lambda: 1)
print(a.a) # prints ${hello:1}

Expected: 1

The major issue this causes is when I want to register a resolver for an environmental variable's default value.

Workaround:
Register an overall resolver and resolve environment value yourself in it.

@omry
Copy link
Owner

omry commented Apr 18, 2020

Duplicate of #100

@omry omry marked this as a duplicate of #100 Apr 18, 2020
@omry omry closed this as completed Apr 18, 2020
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

2 participants