Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading BSON saved dataframe raises "import errors" in Pluto #96

Open
jollyredflames opened this issue Apr 16, 2021 · 0 comments
Open

Comments

@jollyredflames
Copy link

The issue seems to be raised as Pluto imports Modules in a way BSON’s macro is not expecting.

This results in the BSON.load function failing if @module is not specified.

I.E:
This fails:
BSON.load("dataframe.BSON")

and this fails:
@load("dataframe.BSON") data_frame

but this seems to be working:
BSON.load("dataframe.BSON", @module)

the failing stack trace is:

ERROR: MethodError: Cannot convert an object of type Module to an object of type Symbol
Closest candidates are:
convert(::Type{T}, ::T) where T at essentials.jl:205
Symbol(::Any...) at strings/basic.jl:229
Stacktrace:
[1] newstruct!(::Method, ::Module, ::Symbol, ::Symbol, ::Int32, ::Type, ::String, ::Nothing, ::Int32, ::Bool, ::Int32, ::Core.CodeInfo)
@ BSON ~/.julia/packages/BSON/aEqHo/src/extensions.jl:99
[2] newstruct_raw(cache::IdDict{Any, Any}, T::Type, d::Dict{Symbol, Any}, init::Module)
@ BSON ~/.julia/packages/BSON/aEqHo/src/extensions.jl:126
[3] (::BSON.var"#45#46")(d::Dict{Symbol, Any}, cache::IdDict{Any, Any}, init::Module)
@ BSON ~/.julia/packages/BSON/aEqHo/src/extensions.jl:141
[4] raise_recursive(d::Dict{Symbol, Any}, cache::IdDict{Any, Any}, init::Module)
@ BSON ~/.julia/packages/BSON/aEqHo/src/read.jl:92
[5] (::BSON.var"#23#24"{IdDict{Any, Any}, Module})(x::Dict{Symbol, Any})
@ BSON ~/.julia/packages/BSON/aEqHo/src/read.jl:98
[6] applychildren!(f::BSON.var"#23#24"{IdDict{Any, Any}, Module}, x::Vector{Any})
@ BSON ~/.julia/packages/BSON/aEqHo/src/BSON.jl:28
[7] raise_recursive
@ ~/.julia/packages/BSON/aEqHo/src/read.jl:98 [inlined]
[8] (::BSON.var"#23#24"{IdDict{Any, Any}, Module})(x::Vector{Any})
@ BSON ~/.julia/packages/BSON/aEqHo/src/read.jl:98
[9] applychildren!(f::BSON.var"#23#24"{IdDict{Any, Any}, Module}, x::Vector{Any})
@ BSON ~/.julia/packages/BSON/aEqHo/src/BSON.jl:28
[10] raise_recursive(v::Vector{Any}, cache::IdDict{Any, Any}, init::Module)
@ BSON ~/.julia/packages/BSON/aEqHo/src/read.jl:98
[11] newstruct_raw(cache::IdDict{Any, Any}, #unused#::Type{Core.TypeName}, d::Dict{Symbol, Any}, init::Module)
@ BSON ~/.julia/packages/BSON/aEqHo/src/anonymous.jl:95
[12] (::BSON.var"#45#46")(d::Dict{Symbol, Any}, cache::IdDict{Any, Any}, init::Module)
@ BSON ~/.julia/packages/BSON/aEqHo/src/extensions.jl:141
[13] raise_recursive(d::Dict{Symbol, Any}, cache::IdDict{Any, Any}, init::Module)
@ BSON ~/.julia/packages/BSON/aEqHo/src/read.jl:92
[14] (::BSON.var"#18#21"{IdDict{Any, Any}, Module})(x::Dict{Symbol, Any})
@ BSON ~/.julia/packages/BSON/aEqHo/src/read.jl:82
[15] applychildren!(f::BSON.var"#18#21"{IdDict{Any, Any}, Module}, x::Dict{Symbol, Any})
@ BSON ~/.julia/packages/BSON/aEqHo/src/BSON.jl:21
[16] _raise_recursive(d::Dict{Symbol, Any}, cache::IdDict{Any, Any}, init::Module)
@ BSON ~/.julia/packages/BSON/aEqHo/src/read.jl:82
[17] raise_recursive(d::Dict{Symbol, Any}, cache::IdDict{Any, Any}, init::Module)
@ BSON ~/.julia/packages/BSON/aEqHo/src/read.jl:93
[18] (::BSON.var"#45#46")(d::Dict{Symbol, Any}, cache::IdDict{Any, Any}, init::Module)
@ BSON ~/.julia/packages/BSON/aEqHo/src/extensions.jl:139
[19] raise_recursive(d::Dict{Symbol, Any}, cache::IdDict{Any, Any}, init::Module)
@ BSON ~/.julia/packages/BSON/aEqHo/src/read.jl:92
[20] (::BSON.var"#19#22"{IdDict{Any, Any}, Module})(x::Dict{Symbol, Any})
@ BSON ~/.julia/packages/BSON/aEqHo/src/read.jl:86
[21] applychildren!(f::BSON.var"#19#22"{IdDict{Any, Any}, Module}, x::Dict{Symbol, Any})
@ BSON ~/.julia/packages/BSON/aEqHo/src/BSON.jl:21
[22] _raise_recursive(d::Dict{Symbol, Any}, cache::IdDict{Any, Any}, init::Module)
@ BSON ~/.julia/packages/BSON/aEqHo/src/read.jl:86
[23] raise_recursive(d::Dict{Symbol, Any}, cache::IdDict{Any, Any}, init::Module)
@ BSON ~/.julia/packages/BSON/aEqHo/src/read.jl:93
[24] raise_recursive
@ ~/.julia/packages/BSON/aEqHo/src/read.jl:103 [inlined]
[25] load (repeats 2 times)
@ ~/.julia/packages/BSON/aEqHo/src/read.jl:108 [inlined]
[26] top-level scope
@ REPL[3]:1

It seems this issue can be simply fixed by searching for the package programitcally rather than searching for the macro.

This would be the expected behaviour for this package as this will allow it to be used in a variety of editors (allowing for support for julia REPL, as well as notebooks like Pluto).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant