JuliaIO / JLD.jl

Saving and loading julia variables while preserving native types
MIT License
278 stars 55 forks source link

unable to load JLD - Core.AbstractArray{#s831,1},#s831 #299

Closed kafisatz closed 2 years ago

kafisatz commented 3 years ago

I ran into this today (after updating to Julia 1.6 and updating a bunch of packages). When saving and then loading a simple DataFrame I run into the error in the snippet.

However, I cannot reproduce this with an MWE. When starting a new Julia session with only JLD and DataFrames loaded, everything works fine and the type of the array seems to be Core.AbstractArray{T,1},T instead of s831 (see mwe_works for a proper JLD file of the data).

here is the zipped jld file from the snippet below. here i have fifi.zip I have created this in a session of a private package that uses several packages (which do not interact with JLD or DataFrames though)

  [fbb218c0] BSON v0.3.3
  [6e4b80f9] BenchmarkTools v0.7.0
  [336ed68f] CSV v0.8.4
  [a93c6f00] DataFrames v1.0.2
  [31c24e10] Distributions v0.24.18
  [ff294ebf] ExcelWriter v0.1.0 `https://github.com/kafisatz/ExcelWriter.jl/#master`
  [da1fdf0e] FreqTables v0.4.4
  [38e38edf] GLM v1.4.2
  [4138dd39] JLD v0.12.3
  [3b13c9e7] MultiWayAggregation v0.1.0 `https://github.com/kafisatz/MultiWayAggregation.jl#master`
  [2913bbd2] StatsBase v0.33.8
  [ade2ca70] Dates
  [10745b16] Statistics

here is how the JLD file should look like: mwe_works.zip

julia> jldfi = raw"c:\temp\fifi.jld"
"c:\\temp\\fifi.jld"

julia> d = DataFrame(a=1,b=57,c=1784,d=0,e=8,f=3046.26,g=15,h=232)
1×8 DataFrame
 Row │ a      b      c      d      e      f        g      h     
     │ Int64  Int64  Int64  Int64  Int64  Float64  Int64  Int64 
─────┼──────────────────────────────────────────────────────────
   1 │     1     57   1784      0      8  3046.26     15    232

julia> @save jldfi d

julia> @load jldfi d
error parsing type string @where(Core.AbstractArray{#s831,1},#s831)
ERROR: syntax: incomplete: premature end of input
Stacktrace:
 [1] top-level scope
   @ none:1

[a93c6f00] DataFrames v1.0.2
[4138dd39] JLD v0.12.3
kafisatz commented 3 years ago

Reverting to Julia 1.5.4 is a feasible work around for the time being.

kafisatz commented 2 years ago

this is resolved now (not sure why though)