queryverse / Query.jl

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

@mutate can not use any statistics function #276

Closed norci closed 5 years ago

norci commented 5 years ago

Query v0.12.0

@mutate can't, but @map can.

data|>

@mutate(M=mean(_.Data))

UndefVarError: mean not defined

Stacktrace:
 [1] (::getfield(Main, Symbol("##152#154")))(::NamedTuple{(:Data,),Tuple{Array{Float64,1}}}) at /opt/julia/packages/Query/165ER/src/query_translation.jl:58
 [2] iterate at /opt/julia/packages/QueryOperators/cAcyh/src/enumerable/enumerable_map.jl:25 [inlined]
 [3] printsequence(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::QueryOperators.EnumerableMap{Any,QueryOperators.EnumerableIterable{NamedTuple{(:Data,),Tuple{Array{Float64,1}}},Tables.DataValueRowIterator{NamedTuple{(:Data,),Tuple{Array{Float64,1}}},Tables.RowIterator{NamedTuple{(:Data,),Tuple{Array{Array{Float64,1},1}}}}}},getfield(Main, Symbol("##152#154"))}) at /opt/julia/packages/QueryOperators/cAcyh/src/enumerable/show.jl:10
 [4] show at /opt/julia/packages/QueryOperators/cAcyh/src/enumerable/show.jl:37 [inlined]
 [5] show at ./sysimg.jl:194 [inlined]
 [6] limitstringmime(::MIME{Symbol("text/plain")}, ::QueryOperators.EnumerableMap{Any,QueryOperators.EnumerableIterable{NamedTuple{(:Data,),Tuple{Array{Float64,1}}},Tables.DataValueRowIterator{NamedTuple{(:Data,),Tuple{Array{Float64,1}}},Tables.RowIterator{NamedTuple{(:Data,),Tuple{Array{Array{Float64,1},1}}}}}},getfield(Main, Symbol("##152#154"))}) at /opt/julia/packages/IJulia/cwvsj/src/inline.jl:37
 [7] display_mimestring(::MIME{Symbol("text/plain")}, ::QueryOperators.EnumerableMap{Any,QueryOperators.EnumerableIterable{NamedTuple{(:Data,),Tuple{Array{Float64,1}}},Tables.DataValueRowIterator{NamedTuple{(:Data,),Tuple{Array{Float64,1}}},Tables.RowIterator{NamedTuple{(:Data,),Tuple{Array{Array{Float64,1},1}}}}}},getfield(Main, Symbol("##152#154"))}) at /opt/julia/packages/IJulia/cwvsj/src/display.jl:67
 [8] display_dict(::QueryOperators.EnumerableMap{Any,QueryOperators.EnumerableIterable{NamedTuple{(:Data,),Tuple{Array{Float64,1}}},Tables.DataValueRowIterator{NamedTuple{(:Data,),Tuple{Array{Float64,1}}},Tables.RowIterator{NamedTuple{(:Data,),Tuple{Array{Array{Float64,1},1}}}}}},getfield(Main, Symbol("##152#154"))}) at /opt/julia/packages/IJulia/cwvsj/src/display.jl:96
 [9] #invokelatest#1 at ./essentials.jl:742 [inlined]
 [10] invokelatest at ./essentials.jl:741 [inlined]
 [11] execute_request(::ZMQ.Socket, ::IJulia.Msg) at /opt/julia/packages/IJulia/cwvsj/src/execute_request.jl:112
 [12] #invokelatest#1 at ./essentials.jl:742 [inlined]
 [13] invokelatest at ./essentials.jl:741 [inlined]
 [14] eventloop(::ZMQ.Socket) at /opt/julia/packages/IJulia/cwvsj/src/eventloop.jl:8
 [15] (::getfield(IJulia, Symbol("##15#18")))() at ./task.jl:259
davidanthoff commented 5 years ago

Fixed on master, I'm tagging a release now.