queryverse / Query.jl

Query almost anything in julia
Other
395 stars 50 forks source link

Query Fails on columns of type Any #310

Open babaq opened 4 years ago

babaq commented 4 years ago
df = DataFrame(id=1:3,p=[[1, missing],[2, 3],[3, 4,missing]])

@from i in df begin
    @from j in i.p
    @select {i.id,p=j}
    @collect DataFrame
end

the above works because the column id has type Int, and column p has type Vector{Array{Union{Missing, Int64},1}}, but it fails on

df = DataFrame(id=1:3,p=Any[[1, missing],[2, 3],[3, 4,missing]])

This seems to me a bug, because the result DataFrame of above query have all the columns having type Any, preventing further query operations on the query result.

code tested on Query master v0.12.3-DEV, Julia v1.4.2 on windows 10.