-
Notifications
You must be signed in to change notification settings - Fork 121
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
[bug] OmegaConf.merge should respect interpolations #184
Comments
Thanks, I will take a look before 2.0 is released. By the way, you can compare to primitive maps directly: assert third == {
"a": {
"aa": 1,
"ab": 2
},
"b": {
"aa": 1,
"ab": 2,
"ba": 1,
"bb": 2
}
} |
What you expect is not what should happen. {
"a": {
"aa": 1,
"ab": 2,
"ba": 1,
"bb": 2
},
"b": "${a}"
} Which is equivalent but not the same. |
However, interpolations are not writethrough. cfg = OmegaConf.create({
"a": 10,
"b" : "${a}"
})
cfg.b = 20 To result in a: 20
b: ${a} But this is useful: you can achieve the same result by just modifying instead, this results in: a: 10
b: 20 This is a conscience choice, and I don't want to make node interpolation inconsistent with this choice. |
Regardless of pointer interpretation I would still expect Merge to respect interpolations. For the example you gave, I would say it is more of the choice on your end on how you would like to handle it in OmegaConf. Nevertheless, I have been thinking of interpolations as pass by value rather than pass by reference. |
Version: 2.0.0rc16
The text was updated successfully, but these errors were encountered: