-
Notifications
You must be signed in to change notification settings - Fork 30
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
Handling of Empty and None values in dtype.py lead to load errors #245
Comments
Should we consistently
|
hi! I would vote for the first solution: always return the default dtype for "" or None |
I agree, return default value. Or, we could return None for any non-existing value |
My vote is to always return the default value. |
ok, let's do it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The value handling of lists of "empty" values in
dtypes.py
lead to different results andpotentially broken odML documents:
int and float replace None by default values. Can be saved and loaded.
prop = odml.Property(name="int", value=[""], dtype="int")
leads to
prop.value
...[0]
prop = odml.Property(name="float", value=[None, None], dtype="float")
leads to
prop.value
...[0.0, 0.0]
string related dtypes (string, text, url, person) replace None by "None". Can be saved and loaded.
prop = odml.Property(name="str", value=["", None], dtype="string")
leads to
prop.value
...['', 'None']
bool, date, time and datetime save None to file but leads to an Error that is hard to identify when the file is loaded.
prop = odml.Property(name="date", value=[None], dtype="date")
leads on document load to
ValueError: odml.Property.value: passed values are not of consistent type!
The text was updated successfully, but these errors were encountered: