Hi there,
i’m afraid I discovered a bug while working with DataFrames and JDF.
But the problem seems to be related to WeakRefStrings:
What do you think?
Greetings
Parazetamol
using DataFrames, JDF
# DataFrames v1.6.1
# JDF v0.5.2
# julia 1.9.2
# ubuntu-22.04
# The story started for me with a DataFrame loaded using JDF:
df1 = DataFrame(b=[1,2], a=[missing,"2"])
df2 = DataFrame(b=[1,2], a=[missing,"2"])
# save for loading later
df1_tmp = tempname()
df2_tmp = tempname()
JDF.save(df1_tmp, df1)
JDF.save(df2_tmp, df2)
append!(df1, df2) # => everything ok
# append! does not work on the same DataFrame loaded
df1 = JDF.load(df1_tmp) |> DataFrame
df2 = JDF.load(df2_tmp) |> DataFrame
# while vcat works fine
vcat(df1, df2) # => everything ok
# append! produces #undef
append!(df1, df2) # => resulting df1.a has a row containing #undef instead of missing.
# problem seems to be related to WeakRefStrings:
# restore df1
df1 = JDF.load(df1_tmp) |> DataFrame
v1 = df1[!,:a]
# ->
# 4-element WeakRefStrings.StringVector{Union{Missing, String}}:
# missing
# "2"
v2 = df2[!,:a]
append!(v1, v2)
# ->
# 4-element WeakRefStrings.StringVector{Union{Missing, String}}:
# missing
# "2"
# #undef
# "2"