Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Dict[str, Optional[str]] fails #460

Closed
omry opened this issue Dec 15, 2020 · 3 comments · Fixed by #749
Closed

Dict[str, Optional[str]] fails #460

omry opened this issue Dec 15, 2020 · 3 comments · Fixed by #749
Labels
bug Something isn't working

Comments

@omry
Copy link
Owner

omry commented Dec 15, 2020

from dataclasses import *
from typing import *
from omegaconf import OmegaConf
@dataclass
class Foo:
    a : Dict[str, Optional[str]]

OmegaConf.structured(Foo)

Raises an assertion failure

@omry omry added the bug Something isn't working label Dec 15, 2020
@omry omry added this to the OmegaConf 2.1 milestone Dec 15, 2020
@omry
Copy link
Owner Author

omry commented Feb 3, 2021

@pereman2, related to your ongoing work on better containers support.

@Jasha10
Copy link
Collaborator

Jasha10 commented Jun 2, 2021

I think this will require expanding what DictConfig._metadata can handle.

For example, DictConfig({}, element_type=str) works but DictConfig({}, element_type=Optional[str]) fails.

@omry
Copy link
Owner Author

omry commented Jun 2, 2021

Sounds right.

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

Successfully merging a pull request may close this issue.

3 participants