Version: Next

Changes to default composition order

Default composition order is changing in Hydra 1.1.

For this example, let's assume the following two configs:

config.yaml
defaults:
- foo: bar
foo:
x: 10
foo/bar.yaml
# @package _group_
x: 20

In Hydra 1.0, configs from the Defaults List are overriding config.yaml, resulting in the following output:

foo:
x: 20

As of Hydra 1.1, config.yaml is overriding configs from the Defaults List, resulting in the following output:

foo:
x: 10

Migration#

For the majority of applications, this will not cause issues. If your application requires the previous behavior, you can achieve it by adding _self_ as the first item in your Defaults List:

config.yaml
defaults:
- _self_
- foo: bar
foo:
x: 10
Output config
foo:
x: 20

The Defaults List is described here.

Last updated on by Omry Yadan