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

Feature: dataclass fields without a value can automatically indicate MISSING #390

Closed
omry opened this issue Sep 24, 2020 · 0 comments
Closed
Milestone

Comments

@omry
Copy link
Owner

omry commented Sep 24, 2020

An historical decision was to enforce the usage of omegaconf.MISSING to indicate that a value is missing.

from omegaconf import MISSING

@dataclass
class User:
   name: str = MISSING

This creates a dependency on OmegaConf from the user dataclasses.
A better approach is to allow constructing OmegaConf configs from values that just does not specify the default value and convert it automatically to omegaconf.MISSING when constructing the config object to maintain the semantics.

@dataclass
class User:
   name: str
@omry omry added this to the OmegaConf 2.1 milestone Sep 24, 2020
@omry omry changed the title Consider support for dataclass fields without a value to indicate MISSING Feature: dataclass fields without a value can automatically indicate MISSING Sep 29, 2020
@omry omry closed this as completed Sep 29, 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

1 participant