You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if a source returns a falsey value (False, None, 0, etc.) it will be ignored, and we will continue on to the next source. Falsey values can be valid configuration options, so we need to distinguish a valid None value in a config from a value Not Found None.
Test Cases:
Yaml File sources should be able to set boolean False and None values.
Default True values should be over-written by False values that are set in a higher priority source
The text was updated successfully, but these errors were encountered:
Proposed solution:
We will only officially support String values in configuration sources. Converting string values to other types will be the responsibility of the application.
This is more aligned with Environment Variable, and CLI sources, and seems to be common among other configuration storage services.
We will not actively prevent custom sources from returning non-string values, but Falsey values will continue to be a known problem if you choose to do so.
We may consider a more complex solution, raising exceptions instead of returning None, in the future if a compelling use-case presents its self.
batconf/batconf/source.py
Line 27 in 412297b
Currently, if a source returns a falsey value (False, None, 0, etc.) it will be ignored, and we will continue on to the next source. Falsey values can be valid configuration options, so we need to distinguish a valid
None
value in a config from a value Not FoundNone
.Test Cases:
False
andNone
values.True
values should be over-written byFalse
values that are set in a higher priority sourceThe text was updated successfully, but these errors were encountered: