queryverse / queryverse/IterableTables.jl

Sinking to TimeArray sensitive to Array element type

Open
#53 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Julia
Stars
79
Forks
9
Avg merge
1d 16h
Merged PRs (30d)
2

Description

In code like:

ts3 = @from i in df3 begin
    @select {i.timestamp, i.NMerged}
    @collect TimeArray
end

I get

MethodError: no method matching TimeSeries.TimeArray(::Array{Any,1}, ::Array{Int64,2}, ::Array{String,1})
Closest candidates are:
  TimeSeries.TimeArray(::AbstractArray{D<:Base.Dates.TimeType,1}, ::AbstractArray{T,N}, ::Array{S<:AbstractString,1}, ::Any) where {T, N, D<:Base.Dates.TimeType, S<:AbstractString} at /home/juser/.julia/v0.6/TimeSeries/src/timearray.jl:41
  TimeSeries.TimeArray(::D<:Base.Dates.TimeType, ::AbstractArray{T,N}, ::Array{S<:AbstractString,1}, ::Any) where {T, N, D<:Base.Dates.TimeType, S<:AbstractString} at /home/juser/.julia/v0.6/TimeSeries/src/timearray.jl:44
  TimeSeries.TimeArray(::AbstractArray{D<:Base.Dates.TimeType,1}, ::AbstractArray, ::Any) where D<:Base.Dates.TimeType at /home/juser/.julia/v0.6/TimeSeries/src/timearray.jl:55
  ...

this is because timestamp has Any type, even though all the elements are DateTime. Inserting a df3[:timestamp] = map(identity, df3[:timestamp]) fixes the element type of the column and the error goes away, but I'd like IterableTables to do so by itself (and give a nice error if the timestamp is not of time type).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the shown @collect TimeArray query and inspect the IterableTables entry point that handles collection into TimeArray. Trace how the timestamp column's element type is passed through; done means DateTime-valued columns no longer fail because they are typed as Any, while non-time timestamps produce a clear error.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.