-
Notifications
You must be signed in to change notification settings - Fork 39
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
Cannot save array with undefined values #43
Comments
It seems the culprit is the ... operator. More specifically the code This is where it tries to unpack the values of the array into a new array, but this doesn't work on arrays with '#undef' in them. This behavior works with a different type of array though:
BSON is able to save as expected because x gets initialized with zeros so the ... operator has something to unpack, where as Array{String, 1}(undef, 5) is initialized with #undef, so the ... operator breaks. This seems like an even more basic issue and I see it as two solutions:
|
@MikeInnes and I experimented with some code that bypassed the
Certainly that would work, but would require a breaking change in the Julia language, and I'm not sure if there is support for that. |
Does that mean someone just needs to find a way to read and write |
Yep! |
@DilumAluthge, So if this is fixed you and @MikeInnes can patch the splat operator issue? Because for this whole problem to be solved that will also need to be fixed. Also have you worked on looking at the underlying issue of reading and writing #undef? I don't want to reinvent the wheel if you guys already have good leads. |
Yep! Take a look here at an example of how we can replace the splat operator with a function
You can take a look at Mike's work in #8. In PR #8, Mike wrote I think the best solution is going to be to write a unique sentinel in place of the |
#47 Hopefully should take are of these issues. @MikeInnes |
Bump. Was bitten by this |
I am opening this issue so we can keep track of our progress in solving this bug.
Currently, BSON is unable to save an array that has one or more undefined values. Here is the minimum working example:
Expected behavior: BSON saves the data as requested.
Actual behavior: the following error is thrown:
The text was updated successfully, but these errors were encountered: