Skip to content
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

Regression in serializing + deserializing union vectors introduced in 0.5.6 #617

Closed
KristofferC opened this issue Nov 19, 2024 · 2 comments · Fixed by #618
Closed

Regression in serializing + deserializing union vectors introduced in 0.5.6 #617

KristofferC opened this issue Nov 19, 2024 · 2 comments · Fixed by #618

Comments

@KristofferC
Copy link
Member

KristofferC commented Nov 19, 2024

The following code gives different behavior on JLD2 0.5.5 vs 0.5.6:

using JLD2, DataFrames, Dates

df = DataFrame(date=Date(2014),boolcol=rand([true false],100),randcol=rand(100))
allowmissing!(df)

df[rand(1:100,10),:boolcol] .= missing
df[rand(1:100,10),:randcol] .= missing

jldopen("test.jld2","w") do f
    for n in names(df)
        f[n] = df[!,n]
    end
end

@show eltype(df.boolcol)


df2 = DataFrame()

jldopen("test.jld2","r") do f
    for k in keys(f)
        df2[!,k] = f[k]
    end
end

@show eltype(df2.boolcol)

On 0.5.5 this gives:

eltype(df.boolcol) = Union{Missing, Bool}
eltype(df2.boolcol) = Union{Missing, Bool}

while on 0.5.6 it gives:

eltype(df.boolcol) = Union{Missing, Bool}
eltype(df2.boolcol) = JLD2.InlineUnionEl{Missing, Bool}

So it seems some internal JLD2 type is now getting leaked into the constructed values.

@JonasIsensee
Copy link
Collaborator

Whoops, thanks for the report.
I'll have a look.

@JonasIsensee
Copy link
Collaborator

Version v0.5.9 with a fix should be out later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants