-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Boolean value might get unnecessarily uppercased #4996
Comments
Here , the boolean value true and false should follow neither |
The thing here is what boolean means on the shell context. So, the use of boolean is kind of undefined behaviour, though there's nothing wrong in making it return |
@skshetry |
@karajan1001, they are stringified. The problem is that when YAML is loaded, it gets loaded as Python's boolean in reality. the parser actually just generates a resolved dvc.yaml-like data, and substitutes. This thing has been limited by the schema that we use. It only allows validation, whereas we also need to convert those values. https://github.com/iterative/dvc/blob/master/dvc/schema.py |
I'll solve this issue by just converting boolean stringification to |
It's many times slower than the following for simple conversion: def conv(boolean):
return "true" if boolean else "false" But, your point is valid, in that using Also, we don't support the dict/list in |
Previously, Python's `str()` was being used that resulted in boolean transformed into "True"/"False". Fixes iterative#4996
@johnnychen94, thanks for trying out parametrization. As you seem to use parameterization quite a lot, it'd be great if you could also provide some feedback overall (not just on the bugs but the feature 😜). How's been the experience? You can either respond here or on the original issue #3633. We are hoping to release this feature at the end of the next month with a pre-release scheduled this week. So, any feedback is appreciated and will help us iron out the kinks. Thanks again for the bug report. 🙏 |
Previously, Python's `str()` was being used that resulted in boolean transformed into "True"/"False". Fixes #4996
Bug Report
Python uses
True
/False
as boolean values, while in other languages it might not be the case (Julia usestrue
/false
).It seems that the correct behavior is
dvc
faithfully stores the params as strings, and only does type conversion (str -> bool/int/float) when it needs to output some statistics, e.g.,dvc params diff
.This seems to be an edge case for bool values only, so feel free to close if you don't plan to fix it.
Please provide information about your setup
Output of
dvc version
:Additional Information (if any):
Notice that
opt1
is transformed to"True"
instead of"true"
.The text was updated successfully, but these errors were encountered: