-
-
Notifications
You must be signed in to change notification settings - Fork 318
dynaconf_merge = false supported? #835
Copy link
Copy link
Description
Hello, I would like to know if it is possible to disable merging for some keys of a configs. In our case, we have a bunch of config files (~30) and merging them is the usual behavior. We do this through the Dynaconf parameter merge_enabled. Now, in a few cases the merging leads to undesired behavior and it would be nice to turn off merging for these specific config keys. Is it possible to do this easily without changing up the default merge behavior and touch all the config files? I tried dynaconf_merge = false as a property but this behavior doesn't seem to be supported.
Example:
1.toml
[general]
a = 1
[other]
a = 22.toml
[general]
b = 1
[other]
dynaconf_merge = false
b = 2config.py
from dynaconf import Dynaconf
settings = Dynaconf(
settings_files=["1.toml", "2.toml"],
merge_enabled=True,
)
print(settings.to_dict())Output:
{'GENERAL': {'b': 1, 'a': 1}, 'OTHER': {'b': 2, 'a': 2}}
Expected Output:
{'GENERAL': {'b': 1, 'a': 1}, 'OTHER': {'b': 2}}
Thanks for your time.
Reactions are currently unavailable