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.to_yaml does not handle Structured Configs #350

Closed
omry opened this issue Aug 30, 2020 · 0 comments · Fixed by #351
Closed

OmegaConf.to_yaml does not handle Structured Configs #350

omry opened this issue Aug 30, 2020 · 0 comments · Fixed by #351
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@omry
Copy link
Owner

omry commented Aug 30, 2020

  1. DictConfigs annotated as Structured Configs triggers a type error from mypy:
@dataclass
class User:
    name: str = MISSING
    age: int = MISSING

cfg : User = OmegaConf.structured(User(name="Bond", age=7))
OmegaConf.to_yaml(cfg) # type error here
  1. Other configish objects results in a runtime error:
OmegaConf.to_yaml(User)
OmegaConf.to_yaml(User(name="Bond", age=7))
OmegaConf.to_yaml({"name": "Bond", "age": 7})
@omry omry added bug Something isn't working enhancement New feature or request labels Aug 30, 2020
@omry omry added this to the OmegaConf 2.0.1 milestone Aug 30, 2020
@omry omry self-assigned this Aug 30, 2020
@omry omry closed this as completed in #351 Aug 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant