You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If using map on a KeyedDataset, and the block returns nothing, it errors, because of this line trying to assign nothing as a KeyedArray.
MWE:
julia> ds =KeyedDataset(:input=>KeyedArray([1, 2]; a=[1, 2]));
julia>map(ds) do A
println(typeof(A))
end
KeyedArray{Int64, 1, NamedDimsArray{(:a,), Int64, 1, Vector{Int64}}, Base.RefValue{Vector{Int64}}}
ERROR: MethodError: Cannot `convert` an object of type
Nothing to an object of type
KeyedArray
Closest candidates are:convert(::Type{T}, ::LinearAlgebra.Factorization) where T<:AbstractArray at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/factorization.jl:58convert(::Type{T}, ::T) where T<:AbstractArray at abstractarray.jl:14convert(::Type{T}, ::T) where T at essentials.jl:205
Stacktrace:
[1] setindex!(dd::OrderedCollections.LittleDict{Tuple, KeyedArray, Vector{Tuple}, Vector{KeyedArray}}, value::Nothing, key::Tuple{Symbol})
@ OrderedCollections ~/.julia/packages/OrderedCollections/cP9uu/src/little_dict.jl:219
[2] map!(f::var"#9#10", dest::KeyedDataset, src::KeyedDataset)
@ AxisSets ~/.julia/packages/AxisSets/IddYk/src/functions.jl:49
[3] map(::Function, ::KeyedDataset)
@ AxisSets ~/.julia/packages/AxisSets/IddYk/src/functions.jl:41
[4] top-level scope
@ REPL[16]:1
If the point of map(::KeyedDataset) is only to modify the dataset, that may be fair, but I think it should either have a fallback, or a clearer error.
The text was updated successfully, but these errors were encountered:
Bit of an edge case, but seems valid.
If using
map
on aKeyedDataset
, and the block returnsnothing
, it errors, because of this line trying to assignnothing
as aKeyedArray
.MWE:
If the point of
map(::KeyedDataset)
is only to modify the dataset, that may be fair, but I think it should either have a fallback, or a clearer error.The text was updated successfully, but these errors were encountered: