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
Added a warning if primary config is missing _self_ #1756
Conversation
website/docs/upgrades/1.0_to_1.1/changes_to_default_composition_order.md
Outdated
Show resolved
Hide resolved
website/docs/upgrades/1.0_to_1.1/changes_to_default_composition_order.md
Outdated
Show resolved
Hide resolved
website/docs/upgrades/1.0_to_1.1/changes_to_default_composition_order.md
Outdated
Show resolved
Hide resolved
website/docs/upgrades/1.0_to_1.1/changes_to_default_composition_order.md
Outdated
Show resolved
Hide resolved
The primary feedback I am looking for is about the clarity of the doc changes. |
You can read them in context at the website preview: |
taking another pass of the doc... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall, the doc updates need to be replicated in 1.1 version.
website/docs/upgrades/1.0_to_1.1/changes_to_default_composition_order.md
Show resolved
Hide resolved
website/docs/upgrades/1.0_to_1.1/changes_to_default_composition_order.md
Outdated
Show resolved
Hide resolved
website/docs/upgrades/1.0_to_1.1/changes_to_default_composition_order.md
Outdated
Show resolved
Hide resolved
website/docs/upgrades/1.0_to_1.1/changes_to_default_composition_order.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few edits.
I made each suggestion twice (once for the main docs, once for the versioned docs).
### Composition order of primary config | ||
Your primary config can contain both config values and a Defaults List. | ||
In such cases, you should add the `_self_` keyword to your defaults list to specify the composition order of the config file relative to the items in the defaults list. | ||
|
||
* If you want your primary config to override the values of configs from the Defaults List, append `_self_` to the end of the Defaults List. | ||
* If you want the configs from the Defaults List to override the values in your primary config, insert `_self_` as the first item in your Defaults List. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These guidelines apply to nested configs too, not just the primary config, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. For nested configs, in all cases I have seen so far trailing _self_
makes sense so requiring users to specify it is not something I want to do.
website/docs/upgrades/1.0_to_1.1/changes_to_default_composition_order.md
Outdated
Show resolved
Hide resolved
website/docs/upgrades/1.0_to_1.1/changes_to_default_composition_order.md
Outdated
Show resolved
Hide resolved
website/versioned_docs/version-1.1/upgrades/1.0_to_1.1/changes_to_default_composition_order.md
Outdated
Show resolved
Hide resolved
website/versioned_docs/version-1.1/upgrades/1.0_to_1.1/changes_to_default_composition_order.md
Outdated
Show resolved
Hide resolved
website/versioned_docs/version-1.1/tutorials/structured_config/5_schema.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
#### Requiring users to specify a default list value | ||
### A Note about composition order | ||
The default composition order in Hydra is that values defined in a config are merged into values introduced from configs in the Defaults List - or in other words - overriding them. | ||
This behavior can be unintuitive when your primary config is a Structured Config, like in the example above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely quite unintuitive, though seeing the _self_
makes it a bit clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. Unfortunately this behavior makes a ton of sense in all other use cases and making the behavior special in this unique cases will likely add even more confusion.
Left a few minor nits, but overall, the updated docs will be helpful! Thanks :) |
Closes #1755.
See #1755 and documentation changes in this diff for context.