Open Jasha10 opened 1 year ago
Are there any updates on this? If you stumble into this problem, finding out that this is (most likely :D) not a issue in your config but this bug is quite hard to find out.
@johnzielke no updates at this time.
It may be the stupid answer, but why not
# ...omit!!
cfg = OmegaConf.merge(
ServerConfig,
{"db": DatabaseConfig}, # why not just directly set it with dataclass ?
{"model": {"data_source": TableConfig}},
)
Suppose, you already have initialized some value
# ...omit!!
# directly assign more clearly then intepolation..
db_tab = DatabaseConfig.table_cfg
cfg = OmegaConf.merge(
ServerConfig,
{"db": DatabaseConfig}, # why not just directly set it with db_tab instance ?
{"model": {"data_source": db_tab}},
)
The point here: once the instance is initialized, it will be impossible (and not necessary) to do argument interpolation. If you want to sync some arguments between the dataclass configs, just add some code to assign the shallow copy of the value.
Hope this helpful & close the issue ~
Also having the same problem - would love to have it fixed.
Describe the bug As described in https://github.com/facebookresearch/hydra/issues/2416, merging a config with an interpolation key into a structured config can fail with an InterpolationKeyError or a ValidationError.
To Reproduce There are two failure modes identified in https://github.com/facebookresearch/hydra/issues/2416.
Mode 1: merging an interpolation into an optional None value
Mode 2: merging an interpolation into a structured value
Expected behavior I don't think either merge above should result in an error.
Additional context OmegaConf version: HEAD (commit 8d110fc)