-
Notifications
You must be signed in to change notification settings - Fork 122
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
null as default value for env interpolation #230
Comments
smells like a bug to me. |
PR welcome :) |
The docs does not specify the type of arguments and currently they are strings.
There is a case to make for converting the strings to a primitive or even with yaml_decode but the parsing now is very primitive and I really don't want to support something as sophisticated as yaml there. Let me think about it, I am leaning toward keeping things as is. giving arbitrary types may not be simpler for the receiving code. for example the registered resolver will need to handle a plathora of types based on what the user is passing in which will probably make most cases more complicated, only to simplify one case (yours). |
A current workaround for this is to pass empty string as default parameter. This will give empty string back. Then |
default value where? code? config? |
|
Okay, I can consider adding a flag to register resolver that will cause the variables to be converted to primitives for 2.1. |
blocked on #445 |
* Add a grammar to parse interpolations * Add support for nested interpolations * Deprecate register_resolver() and introduce new_register_resolver() (that allows resolvers to use non-string arguments, and to decide whether or not to use the cache) * The `env` resolver now parses environment variables in a way that is consistent with the new interpolation grammar Fixes #100 #230 #266 #318
Just a note that as of 2.1, one should use the new |
If I pass null as default value to env interpolation, as with yaml, I expect to get the value as None, but I get the string 'null'.
If this is a not a bug, how can I specify None as the default value?
The text was updated successfully, but these errors were encountered: