-
-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recursive defaults support #171
Comments
Would like to see this, I have a bunch of options for config groups, when I find the ones that work well using command line overrides I'd like to dump them into a config file so I don't have to worry about the long command line again. |
The plan is to implement this for 1.1. |
How does recursive defaults work with package overrides? e.g. something like this:
|
The key for overriding becomes group@package is you have a package override. |
I can't seem to make the above example work with the commit that's just added. I ended up with
|
Looks like you are adding the model in two places. This is documented here: (Unfortunately this is not in the website yet due to some issue we are looking into). If you think you have found a bug or have a question about the recursive defaults open a new issue. |
You can look at the resulting defaults list (and some other info with |
I am not ruling out a bug though, play with it and if you think there is a bug open a new issue with a minimal example, along with what config you are trying to compose (which is missing here). |
@omry is there an ETA for this feature and for Hydra 1.1? |
This feature (or more accurately the one from #1170 a complete rewrite that is not merged yet) is more or less ready (mostly only documentation and some followups are missing). There are a number of other things which are also planned for Hydra 1.1. I am guestimating that initial release candidate will be ready sometimes during H1 2021. Keep in mind that Hydra 1.1 will take even longer to hit fbcode due to the monorepo nature of it. |
Hydra does not currently support a recursive defaults list. the defaults are only specified at the primary config file.
There is some special support for Hydra itself, but this can be ignored for the purpose of this issue.
Recursive defaults list are tricky, it's important to ensure intuitive and consistent order of merging.
Proposed logic
if the defaults in the primary file are in that order:
main.yaml
The relative order should be preserved. it is however possible for other files to be injected in between aa and bb, for example if aa/x1 had it's own defaults:
aa/x1.yaml
the resulting defaults list might looks like:
Let's look at a more complicated case:
main.yaml
aa/x1.yaml
In this case, the result should be:
the resulting intermediate list will looks like:
but the final result will be:
Note how cc retains it's order in the list, but got the last value.
The rule here is:
db
indb=mysql
).mysql
indb=mysql
) is determined by the last mention of the group).The text was updated successfully, but these errors were encountered: