diff --git a/src/persistence/common.jl b/src/persistence/common.jl index 2c3b94b01..5c38b1e55 100644 --- a/src/persistence/common.jl +++ b/src/persistence/common.jl @@ -70,8 +70,13 @@ The default graph name assigned to `gname` may change in the future. function savegraph(fn::AbstractString, g::AbstractGraph, gname::AbstractString, format::AbstractGraphFormat; compress=nothing ) - compress === nothing || - Base.depwarn("Saving compressed graphs is no longer supported in LightGraphs. Use `LGCompressedFormat()` from the `GraphIO.jl` package instead. Saving uncompressed.", :savegraph) + if compress !== nothing + if !compress + @info("Note: the `compress` keyword is no longer supported in LightGraphs. Saving uncompressed.") + else + Base.depwarn("Saving compressed graphs is no longer supported in LightGraphs. Use `LGCompressedFormat()` from the `GraphIO.jl` package instead. Saving uncompressed.", :savegraph) + end + end io = open(fn, "w") try return savegraph(io, g, gname, format) diff --git a/test/persistence/persistence.jl b/test/persistence/persistence.jl index efc3dd920..62a86be7a 100644 --- a/test/persistence/persistence.jl +++ b/test/persistence/persistence.jl @@ -11,6 +11,7 @@ @test_deprecated r"Saving compressed graphs is no longer supported" savegraph(f, p1; compress=true) @test savegraph(f, p1) == 1 @test_deprecated r"Saving compressed graphs is no longer supported" savegraph(f, p1, LGFormat(); compress=true) + @test_logs (:info,r"Note: the `compress` keyword is no longer supported in LightGraphs") savegraph(f, p1; compress=false) @test savegraph(f, p1, LGFormat()) == 1 @test savegraph(f, p2) == 1 @test (ne(p2), nv(p2)) == (9, 10)