Slash in default option normalization
Hydra 1.4 normalizes Defaults List items that contain a slash in their value (e.g. foo: bar/baz) into their canonical format early during defaults composition.
Changes to Defaults List Composition
Historically, you could specify a Defaults List entry like:
# config.yaml
defaults:
- foo: bar/baz
In Hydra 1.3, this resulted in:
- Config Group:
foo - Option:
bar/baz
This caused surprising relative-defaults composition bugs inside foo/bar/baz.yaml. For example, any relative defaults declared within foo/bar/baz.yaml resolved relative to foo rather than the correct path foo/bar.
In Hydra 1.4, this shorthand is normalized early to:
# config.yaml
defaults:
- foo/bar: baz
This ensures that:
- Config Group is
foo/bar. - Option is
baz. - Nested relative defaults in
foo/bar/baz.yamlnow resolve relative tofoo/baras expected.
Breaking Surface & Package Changes
Normalizing foo: bar/baz to foo/bar: baz keeps the underlying config path but has the following package and override consequences:
- Override Key Change: The override key changes from
footofoo/bar. If your command line overrides previously usedfoo=bar/baz, they must now usefoo/bar=baz. - Package Name Change: By default, the package location of the option changes from
footofoo.bar. This can move where the composed dictionary keys are nested in the final output configuration.
Migration
If your application relied on the old behavior where defaults nested inside foo/bar/baz.yaml resolved relative to foo (and thus you placed those nested configs at foo/ instead of foo/bar/), Hydra 1.4 detects this mismatch and raises a clear error:
Could not load 'foo/bar/nested'.
However, a config was found at 'foo/nested', which indicates this application relies on the deprecated slash-containing default option shorthand behavior.
To fix this, either:
- Move the nested config files to their correct directory location under the normalized group path (e.g. move
foo/nested.yamltofoo/bar/nested.yaml), or - Explicitly rewrite the defaults list entries using canonical absolute paths.