JuliaDB.jl icon indicating copy to clipboard operation
JuliaDB.jl copied to clipboard

map(f,x::DNDSparse) produces wrong parametric type if f changes value type

Open gkappler opened this issue 5 years ago • 1 comments

A = ndsparse((numid=1:10,), (a=1:10,b=1:10); chunks=2)
B = map(v->v.a+1,A)

seems to work, but assigns wrong type parameter typeof(B)

JuliaDB.DNDSparse{NamedTuple{(:numid,),Tuple{Int64}},NamedTuple{(:a, :b),Tuple{Int64,Int64}}}

which makes

C = filter(isodd, B)

fail with

ERROR: column a not found.

gkappler avatar Dec 10 '19 16:12 gkappler

I investigated a bit and think the minor fix in pull request #316 suffices.

typeof(B) in the example is now

JuliaDB.DNDSparse{NamedTuple{(:numid,),Tuple{Int64}},Int64}

gkappler avatar Dec 10 '19 16:12 gkappler