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

Can't assign None to optional field currently interpolated to a non-optional one #524

Closed
odelalleau opened this issue Feb 7, 2021 · 0 comments · Fixed by #525
Closed
Labels
bug Something isn't working
Milestone

Comments

@odelalleau
Copy link
Collaborator

Describe the bug

The following code should work, but currently crashes with ValidationError: child 'b' is not Optional:

@dataclass
class Config:
    a: int = 3
    b: Optional[int] = "${a}"
        
cfg = OmegaConf.structured(Config)
cfg.b = None

To Reproduce
See above

Expected behavior
No error

Additional context
This is on current master (8103a84)

@odelalleau odelalleau added the bug Something isn't working label Feb 7, 2021
@omry omry added this to the OmegaConf 2.1 milestone Feb 7, 2021
odelalleau added a commit to odelalleau/omegaconf that referenced this issue Feb 7, 2021
@omry omry closed this as completed in #525 Feb 8, 2021
omry pushed a commit that referenced this issue Feb 8, 2021
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