JLD2 CodecLz4 compression stopped working

Hi,

all of a sudden, compressing a Jld2 with Lz4 throws an error:

using JLD2
using CodecLz4

name = rand(10)
detail = rand(10)
values = rand(10)

jldopen("./test.jdl2", "w"; compress = LZ4FrameCompressor()) do f
                        f["name"] = name 
                        f["detail"] = detail
                        f["values"] = values            
                    end

ERROR: ArgumentError: Failed to interpret the compression argument.
Stacktrace:
 [1] normalize_filters(compress::LZ4FrameCompressor)
   @ JLD2.Filters ~/.julia/packages/JLD2/WDhXU/src/Filters.jl:161
 [2] jldopen(fname::String, wr::Bool, create::Bool, truncate::Bool, iotype::Type{…}; fallback::Type{…}, compress::LZ4FrameCompressor, mmaparrays::Bool, typemap::Function, parallel_read::Bool, plain::Bool)
   @ JLD2 ~/.julia/packages/JLD2/WDhXU/src/JLD2.jl:185
 [3] jldopen(fname::String, mode::String; iotype::Type, kwargs::@Kwargs{compress::LZ4FrameCompressor})
   @ JLD2 ~/.julia/packages/JLD2/WDhXU/src/JLD2.jl:297
 [4] jldopen(::Function, ::String, ::Vararg{String}; kws::@Kwargs{compress::LZ4FrameCompressor})
   @ JLD2 ~/.julia/packages/JLD2/WDhXU/src/loadsave.jl:2
 [5] top-level scope
   @ REPL[10]:1
Some type information was truncated. Use `show(err)` to see complete types.

It used to work like one month ago.
My packages are up-to-date.

1 Like

Maybe there’s an upstream change:

I added this to the previous code:

using JLD2Lz4

jldopen("./test.jdl2", "w"; compress = Lz4Filter()) do f
                        f["name"] = name
                        f["detail"] = detail
                        f["values"] = values
                    end

Looks like the compression is working now, but I didn’t try yet to read the archive.

Seems ok:

julia> JLD2.load("./test.jdl2")
Dict{String, Any} with 3 entries:
  "name"   => [0.212438, 0.174893, 0.846498, 0.326715, 0.131913, 0.87852, 0.118283, 0.165016, 0.816943, 0.969886]
  "values" => [0.643116, 0.362288, 0.354138, 0.86716, 0.112778, 0.121993, 0.696981, 0.825894, 0.859359, 0.1539]
  "detail" => [0.874008, 0.511029, 0.0107484, 0.721257, 0.741567, 0.664445, 0.237355, 0.506097, 0.60906, 0.644165]