Closed Ssloto closed 2 years ago
Just realized it also does this when an int is set to 0
Hello,
Thanks for the heads up. Indeed it's not what is expected in this kind of situation, I'll have a look ASAP.
If you've spare time then feel free to propose a pull request to fix this behaviour.
First, sorry for my late reply. I'm able to reproduce your issue.
Indeed it would be preferable to return the value instead of raising this message. I think its a side effect of the lib we use to parse data.
Will be fixed in the next release by https://github.com/openuado/niet/commit/11df54ac9245fa9cd7ef1b13e0fea4e4432cc651
Unfortunately this patch only fix keys equal to False
and 0
. By default, the lib we use to parse the data return None when an element is not found, so we are not able to differentiate an element not found and something that is set to Null
.
I'll try to see if we have an other way to capture the null
values.
If I have a YAML file, e.g. with the parameters:
Then I get the following error when I try to access foo or bar on the CLI
The same yaml file will return a value for the same parameters if the value is 'true.'
It would be nice to instead return the value corresponding to the key, which would be null or false. I am using niet v2.4.0.