omegaconf
omegaconf copied to clipboard
Resolving nested structured config of Lists with interpolation raises ValidationError
Describe the bug This is a follow up to #847; OmegaConf raises a ValidationError when trying to use an interpolation inside a structured ListConfig.
To Reproduce
from omegaconf import OmegaConf, MISSING, II
from dataclasses import dataclass
from typing import List
@dataclass
class User:
name: str = MISSING
@dataclass
class Config:
user: User = User("John")
admins: List[User] = "[${user}]"
cfg: Config = OmegaConf.structured(Config)
OmegaConf.resolve(cfg) # this raises ValidationError
Expected behavior I expect this resolution to not fail.
Additional context
- [x] OmegaConf version: 2.2.3
- [x] Python version: 3.9
- [x] Operating system: macOS 12.5.1
- [x] Please provide a minimal repro