Skip to content

Confusing error with mixed-type inputs #270

Open
@aplavin

Description

@aplavin

I found a strange behaviour with mixed-type inputs. 2D arrays work correctly:

[(a=1,) (a='a',)] |> @filter(isa(_.a, Char)) |> collect

1-element Array{NamedTuple{(:a,),T} where T<:Tuple,1}:
 (a = 'a',)

However, 1D do not:

[(a=1,) (a='a',)][:] |> @filter(isa(_.a, Char)) |> collect

Schemaless sources cannot be passed to datavaluerows.

Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] datavaluerows(::Array{NamedTuple{(:a,),T} where T<:Tuple,1}) at /users/aplavin/.julia/packages/Tables/NEFJq/src/tofromdatavalues.jl:72
 [3] getiterator(::Array{NamedTuple{(:a,),T} where T<:Tuple,1}) at /users/aplavin/.julia/packages/Tables/NEFJq/src/Tables.jl:189
 [4] query(::Array{NamedTuple{(:a,),T} where T<:Tuple,1}) at /users/aplavin/.julia/packages/QueryOperators/PfROc/src/source_iterable.jl:7
 [5] (::getfield(Main, Symbol("##134#136")))(::Array{NamedTuple{(:a,),T} where T<:Tuple,1}) at /users/aplavin/.julia/packages/Query/UeHfO/src/standalone_query_macros.jl:221
 [6] |>(::Array{NamedTuple{(:a,),T} where T<:Tuple,1}, ::getfield(Main, Symbol("##134#136"))) at ./operators.jl:813
 [7] top-level scope at In[37]:1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions