Replies: 2 comments 3 replies
-
Yeah, merging lists is a recurring pain point. I'm pretty sure there have been discussions on this topic (possibly in Hydra) but I can't easily find them. This SO post (https://stackoverflow.com/questions/61315623/omegaconf-can-i-influence-how-lists-are-merged) has a link to #131 as a potential way to control such behavior with type annotations in structured configs. Another use case of adding more control on the merge behavior would be the ability to completely overwrite a I think overall it's definitely a useful thing to have, but it's a bit unclear what's the best way to implement it. Feel free to suggest ideas though! |
Beta Was this translation helpful? Give feedback.
-
hmmm...Interesting... The way I've implemented it so far is to have a special token in the list being merged in (currently "OmegaConf.list_merge_append") that triggers the desired behaviour in
I do like the idea of resolvers though in that there is a hook to add custom functionality. Some sort of callback/hook provided by the user when merging could be useful? |
Beta Was this translation helpful? Give feedback.
-
I'm evaluating different config libraries/systems and nothing currently does quite what I want, which is to be able to merge configs in a controlled manner and in different ways. At work we have our own config system that has been developed that caters to this but I'd like to replace if for a pure Python solution.
I see DynaConf can merge, but only top level keys. OmegaConf is better in that respect in that it will merge deeply nested structures, however the config being merging in always overwrites the config to merge into. If a list is being merged, sometimes I would like concat/append and sometimes I would like to overwrite it completely.
I've got a patch to add that feature, just to explore the codebase and possibilities, however I'm not sure if this is something that would be wanted. Something to control the merge strategy being used.
Beta Was this translation helpful? Give feedback.
All reactions