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

Reading pure time column is not working #459

Closed
fedxa opened this issue Jun 18, 2019 · 2 comments
Closed

Reading pure time column is not working #459

fedxa opened this issue Jun 18, 2019 · 2 comments

Comments

@fedxa
Copy link

fedxa commented Jun 18, 2019

Reading the test file

time,value
00:00:00,1
00:10:00,2

with the command

CSV.read("t.csv"; dateformat="H:M:S")

gives error

MethodError: no method matching uint64(::Time)
Closest candidates are:
  uint64(!Matched::UInt32) at /home/fedor/.julia/packages/CSV/IwqOm/src/utils.jl:119
  uint64(!Matched::Bool) at /home/fedor/.julia/packages/CSV/IwqOm/src/utils.jl:117
  uint64(!Matched::Float64) at /home/fedor/.julia/packages/CSV/IwqOm/src/utils.jl:116
  ...

Stacktrace:
 [1] detect(::Array{UInt64,1}, ::Int64, ::Array{UInt8,1}, ::Int64, ::Int64, ::Parsers.Options{false,true,false,Missing,UInt8,DateFormat{Symbol("H:M:S"),Tuple{Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'}}}}, ::Int64, ::Int64, ::Dict{Int8,Int8}, ::Float64, ::Array{Dict{String,UInt64},1}, ::Array{UInt64,1}, ::Bool, ::Array{Int8,1}) at /home/fedor/.julia/packages/CSV/IwqOm/src/CSV.jl:461
 [2] parsetape(::Val{false}, ::Int64, ::Dict{Int8,Int8}, ::Array{Array{UInt64,1},1}, ::Int64, ::Array{UInt8,1}, ::Int64, ::Int64, ::Int64, ::Nothing, ::Array{Int64,1}, ::Float64, ::Array{Dict{String,UInt64},1}, ::Array{UInt64,1}, ::Int64, ::Array{Int8,1}, ::Bool, ::Parsers.Options{false,true,false,Missing,UInt8,DateFormat{Symbol("H:M:S"),Tuple{Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'}}}}) at /home/fedor/.julia/packages/CSV/IwqOm/src/CSV.jl:324
 [3] file(::String, ::Int64, ::Bool, ::Int64, ::Nothing, ::Int64, ::Int64, ::Bool, ::Nothing, ::Bool, ::Array{String,1}, ::String, ::Nothing, ::Bool, ::Char, ::Nothing, ::Nothing, ::Char, ::String, ::UInt8, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Dict{Int8,Int8}, ::Bool, ::Float64, ::Bool, ::Bool, ::Bool, ::Bool, ::Nothing) at /home/fedor/.julia/packages/CSV/IwqOm/src/CSV.jl:283
 [4] Type at /home/fedor/.julia/packages/CSV/IwqOm/src/CSV.jl:158 [inlined]
 [5] #read#57 at /home/fedor/.julia/packages/CSV/IwqOm/src/CSV.jl:625 [inlined]
 [6] (::getfield(CSV, Symbol("#kw##read")))(::NamedTuple{(:dateformat,),Tuple{String}}, ::typeof(CSV.read), ::String) at ./none:0
 [7] top-level scope at In[41]:1
@quinnj
Copy link
Member

quinnj commented Jun 20, 2019

Yeah, CSV.jl isn't setup to handle Time automatically yet, but luckily, it wasn't too hard to add. GitHub is giving me a 500 for some reason while trying to create a pull request, so I'll try again later, but if you want to do ] add CSV#jq/time, you could try the functionality out for yourself.

@quinnj quinnj closed this as completed in 03fba5b Jun 20, 2019
@quinnj
Copy link
Member

quinnj commented Jun 20, 2019

I've added support for parsing Time types in #461. Give it a spin and let me know if you run into any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants