queryverse / queryverse/Query.jl
eltype for @map result can be a "malformed" NamedTuple type
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 403
- Forks
- 48
- Avg merge
- 3d 6h
- Merged PRs (30d)
- 6
Description
julia> coll = (row for row in [(a=1, b=Dict{Any,Any}(:c=>1))]) |> @map({_.a, c=_.b[:c]})
1-element query result
(a = 1, c = 1)
julia> typeof(coll)
QueryOperators.EnumerableMap{NamedTuple{(:a, :c),_A} where _A,QueryOperators.EnumerableIterable{NamedTuple{(:a, :b),Tuple{Int64,Dict{Any,Any}}},IterableTables.GeneratorWithElType{NamedTuple{(:a, :b),Tuple{Int64,Dict{Any,Any}}},Base.Generator{Array{NamedTuple{(:a, :b),Tuple{Int64,Dict{Any,Any}}},1},getfield(Main, Symbol("##51#54"))}}},getfield(Main, Symbol("##53#56"))}
julia> eltype(coll)
NamedTuple{(:a, :c),_A} where _A
julia> eltype(coll) <: NamedTuple
false
Note that this breaks isiterabletable without https://github.com/queryverse/TableTraits.jl/pull/11
(v1.2) pkg> st -m Query
Status `~/.julia/environments/v1.2/Manifest.toml`
[e7dc6d0d] DataValues v0.4.12
[1c8ee90f] IterableTables v0.11.0
[1914dd2f] MacroTools v0.5.1
[1a8c2f83] Query v0.12.2
[2aef5ad7] QueryOperators v0.9.1
[10745b16] Statistics
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Julia example with @map and inspecting the resulting eltype; then trace how that type is produced and how it affects isiterabletable, including the referenced TableTraits change. Done means the @map result exposes a valid NamedTuple subtype and no longer breaks isiterabletable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100