Open CarloLucibello opened 3 years ago
Maybe related to this, I see something similar with dataframes.
using DataFrames, BSON
temp_path = ENV["TEMP"]
aa = DataFrame(Dict(:A => [1,2,3], :B => [:a,:b,:c]))
typeof(aa.B) # Vector{Symbol} (alias for Array{Symbol, 1})
# Now saving it
fpath = joinpath(temp_path, "test.bson")
dic = Dict()
dic[:dframe] = aa
BSON.bson(fpath, dic)
# Now loading it one of the columns has its type changed.
dic2 = BSON.load(fpath)
bb = dic2[:dframe]
typeof(bb.B) # Vector{Any} (alias for Array{Any, 1})
The value type of Dict with symbols keys is not preserved (it is broadened to Any)