-
-
Notifications
You must be signed in to change notification settings - Fork 604
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
Fixed +experinent=foo causing unexpected changes to defaults list #1735
Conversation
The approach I took lets overrides come before non-overrides as long as they have a different override key:
|
Nice. Given the underlying motivation for requiring that overrides are end the end is just for clarity and does not serve a functional purpose, I think it's better to just exempt externally appended config groups from the check as I did. |
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.
Given the underlying motivation for requiring that overrides are end the end is just for clarity and does not serve a functional purpose, I think it's better to just exempt externally appended config groups from the check as I did.
Fair enough.
Also, I realized my diff would be a breaking change. The following test would pass on master or on this PR branch, but it fails on my diff with the error message Override 'group1 : file1' is defined before 'group1 : file2'
:
$ cat tests/defaults_list/data/override_only.yaml
defaults:
- override group1: file1
$ cat tests/defaults_list/test_defaults_tree.py | sed '2042,2052!d'
param(
"override_only",
["+group1=file2"],
DefaultsTreeNode(
node=ConfigDefault(path="override_only"),
children=[
GroupDefault(group="group1", value="file1"),
],
),
id="append_to_override_only",
),
This is undoing a previous bug fix for a related problem that attempted to insert the external overrides in the right place.
The idea behind forcing the order is just to communicate to the user that overrides are special and applies to what comes before. In practice the implementation should work correctly even if they are not.
The solution introduced here is to exempt external overrides from the order check.
Closes #1706