Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sinking to TimeArray sensitive to Array element type #53

Open
Keno opened this issue Aug 17, 2017 · 0 comments
Open

Sinking to TimeArray sensitive to Array element type #53

Keno opened this issue Aug 17, 2017 · 0 comments
Milestone

Comments

@Keno
Copy link

Keno commented Aug 17, 2017

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).

@davidanthoff davidanthoff added this to the Backlog milestone Aug 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants