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

[Question] - How does OmegaConf treat dot config. Is a.b.c: 1 treated as a flat key or nested one? #1189

Closed
noklam opened this issue Aug 14, 2024 · 1 comment

Comments

@noklam
Copy link

noklam commented Aug 14, 2024

This is a clarification question as we use OmegaConf to support our configuration system.

Omegaconf support an API with . syntax, i.e. Omegaconf.select("a.b.c"). This implicitly assume that the internal dictionary is a nested dictionary.

For this example

conf = {"a.b.c": 1}
omega_conf = Omegaconf.create(conf)
omega_conf.select("a.b.c") # Return nothing
omega_conf["a.b.c"] # Return 1

Is using nested . key discouraged with OmegaConf or is this a bug? I cannot find any example in the docs so I am raising this issue.

In case flat key is a bad practice, would you be open to support OmegaConf.create converts flat key to nested dict automatically?

@odelalleau
Copy link
Collaborator

This isn't a bug. I'll follow-up in #1188 to avoid duplicated discussions.

@odelalleau odelalleau closed this as not planned Won't fix, can't repro, duplicate, stale Aug 14, 2024
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