Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Serialization/Upgrades/1.7.0.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ push!(upgrade_scripts_set, UpgradeScript(
])

upgraded_dict = rename_types(dict, renamings)

return upgraded_dict
end
))
9 changes: 5 additions & 4 deletions src/Serialization/Upgrades/main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,16 @@ function rename_types(dict::AbstractDict, renamings::Dict{String, String})

if haskey(d, :name)
upg_d[:name] = get(renamings, d[:name], d[:name])
else
elseif haskey(d, :_type)
upg_d[:_type] = get(renamings, d[:_type], d[:_type])
return upg_d
end

if haskey(d, :params)
if d[:params] isa AbstractDict
if haskey(d[:params], :_type)
upg_d[:params][:_type] = upgrade_type(d[:params][:_type])

else
for (k, v) in d[:params]
upg_d[:params][k] = upgrade_type(d[:params][k])
Expand All @@ -131,6 +132,7 @@ function rename_types(dict::AbstractDict, renamings::Dict{String, String})
upg_d[:params] = upgrade_type(d[:params])
end
end

return upg_d
end

Expand Down Expand Up @@ -221,8 +223,7 @@ function upgrade_recursive(upgrade::Function, s::UpgradeState, dict::AbstractDic
upgraded_k = upgrade(s, Dict{Symbol, Any}(:_type => key_params, :data => k))
push!(upgraded_pairs, (upgraded_k, upgraded_v))
end

if key_params in ["Symbol", "Int", "String"]
if key_params in ["Symbol", "Base.Int", "String"]
dict[:data] = Dict{Symbol, Any}()
for (upgraded_k, upgraded_v) in upgraded_pairs
dict[:data][upgraded_k[:data]] = upgraded_v[:data]
Expand Down
1 change: 0 additions & 1 deletion src/Serialization/containers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,6 @@ end
function load_object(s::DeserializerState,
T::Type{<:Dict{S, U}},
params::Dict) where {S <: Union{Int, String, Symbol}, U}

if haskey(params, :value_params)
pairs = Tuple{S, U}[]
for k in keys(s.obj)
Expand Down
2 changes: 1 addition & 1 deletion test/Serialization/upgrades/setup_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if !isdefined(Main, :serialization_upgrade_test_path) ||
!isdir(Main.serialization_upgrade_test_path) ||
!isfile(joinpath(Main.serialization_upgrade_test_path, "LICENSE.md"))

serialization_upgrade_test_path = let commit_hash = "daf6ca1d4a8f80d2da7d506d4ddb593694dd92a2"
serialization_upgrade_test_path = let commit_hash = "eb9f9dcd294e95c469c33ed8c588cdc6accc10c8"
tarball = Downloads.download("https://github.com/oscar-system/serialization-upgrade-tests/archive/$(commit_hash).tar.gz")

destpath = open(CodecZlib.GzipDecompressorStream, tarball) do io
Expand Down
Loading