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

DictConfig.get('missing') inconsistent with python dict.get('missing') #527

Closed
Jasha10 opened this issue Feb 8, 2021 · 1 comment · Fixed by #528
Closed

DictConfig.get('missing') inconsistent with python dict.get('missing') #527

Jasha10 opened this issue Feb 8, 2021 · 1 comment · Fixed by #528
Labels
bug Something isn't working

Comments

@Jasha10
Copy link
Collaborator

Jasha10 commented Feb 8, 2021

This issue describes an inconsistency between DictConfig and python's standard dict:

{"a": 123}.get("b")  # returns None
OmegaConf.create({"a": 123}).get("b")  # currently throws a `ConfigKeyError`

The issue will be resolved in a pull request coming soon, so that DictConfig.get returns None if key is not found.

@omry
Copy link
Owner

omry commented Feb 9, 2021

Thanks.
Can you pull out the fix into it's own pull request? It can have a minimal test that can later be integrated into the more systemic test that discovered it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants