You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from dataclasses import dataclass
import hydra
from hydra.core.config_store import ConfigStore
@dataclass
class A:
i: int = 1
@dataclass
class Config:
a: A = A()
@hydra.main(config_name="config")
def hydra_main(cfg: Config):
print(cfg)
if __name__ == '__main__':
cs = ConfigStore.instance()
cs.store(name='config', node=Config)
hydra_main()
** Stack trace/error message **
$ python hydra.py +a.j=2
Error merging override +a.j=2
Key 'j' not in 'A'
full_key: a.j
reference_type=A
object_type=A
Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
Expected Behavior
{'a': {'i': 1, 'j': 2}}
System information
Hydra Version : 1.0.6, 1.1.0 dev5
Python version : 3.7.9
Virtual environment type and version : pyenv, vent
Operating system : Mac, Ubuntu
The text was updated successfully, but these errors were encountered:
$ python 1.py a.x=10
Could not override 'a.x'.
To append to your config use +a.x=10
Key 'x' is not in struct
full_key: a.x
reference_type=Dict[str, Any]
object_type=A
Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
$ python 1.py +a.x=10
{'a': {'i': 1, 'x': 10}}
About your PR:
I will want to take a closer look at this. not sure I want it fixed.
🐛 Bug
Description
Overriding variable to sub-structured config fails when using CLI
Checklist
To reproduce
** Minimal Code/Config snippet to reproduce **
** Stack trace/error message **
Expected Behavior
System information
The text was updated successfully, but these errors were encountered: