We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When i try to create a Dataset object with None values inside a dict column, like this:
Dataset
from datasets import Dataset, Features, Value Dataset.from_dict( { "dict": [{"a": 0, "b": 0}, None], }, features=Features( {"dict": {"a": Value("int16"), "b": Value("int16")}} ) )
i get ValueError: Got None but expected a dictionary instead.
ValueError: Got None but expected a dictionary instead
At the same time, having None in nested dict feature works, for example, this doesn't throw any errors:
from datasets import Dataset, Features, Value, Sequence dataset = Dataset.from_dict( { "list_dict": [[{"a": 0, "b": 0}], None], "sequence_dict": [[{"a": 0, "b": 0}], None], }, features=Features({ "list_dict": [{"a": Value("int16"), "b": Value("int16")}], "sequence_dict": Sequence({"a": Value("int16"), "b": Value("int16")}), }) )
Other types of features also seem to be nullable (but I haven't checked all of them).
Version of datasets is the latest atm (2.18.0)
datasets
Is this an expected behavior or a bug?
The text was updated successfully, but these errors were encountered:
It looks like a bug, by default every feature should be nullable.
Sorry, something went wrong.
I've linked a PR with a fix :)
@mariosasko awesome thank you!
Successfully merging a pull request may close this issue.
When i try to create a
Dataset
object with None values inside a dict column, like this:i get
ValueError: Got None but expected a dictionary instead
.At the same time, having None in nested dict feature works, for example, this doesn't throw any errors:
Other types of features also seem to be nullable (but I haven't checked all of them).
Version of
datasets
is the latest atm (2.18.0)Is this an expected behavior or a bug?
The text was updated successfully, but these errors were encountered: