JuliaStats / RDatasets.jl

Julia package for loading many of the data sets available in R
GNU General Public License v3.0
159 stars 56 forks source link

remove rows_for_type_detect #68

Closed asinghvi17 closed 5 years ago

asinghvi17 commented 5 years ago

Brings this into compatibility with CSV v0.5.0.

asinghvi17 commented 5 years ago

Should fix the need for https://github.com/JuliaPlots/MakieGallery.jl/commit/917ea9cfe331aff73a5f8ed0349007e66525bb8b

asinghvi17 commented 5 years ago

Travis error:

COUNT::affairs dataset: Error During Test at /home/travis/build/johnmyleswhite/RDatasets.jl/test/dataset.jl:10
  Got exception outside of a @test
  BoundsError: attempt to access 20480-element Array{UInt64,1} at index [20482]
  Stacktrace:
   [1] setindex! at ./array.jl:769 [inlined]
   [2] parseint! at /home/travis/.julia/packages/CSV/2IO2Z/src/CSV.jl:426 [inlined]
   [3] parsetape(::Val{false}, ::Int64, ::Dict{Int8,Int8}, ::Array{UInt64,1}, ::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,Array{Tuple{Ptr{UInt8},Int64},1},UInt8,Nothing}) at /home/travis/.julia/packages/CSV/2IO2Z/src/CSV.jl:269
   [4] #File#20(::Int64, ::Bool, ::Int64, ::Nothing, ::Int64, ::Int64, ::Bool, ::Nothing, ::Bool, ::Array{String,1}, ::String, ::Char, ::Bool, ::Char, ::Nothing, ::Nothing, ::Char, ::Nothing, ::UInt8, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Dict{Int8,Int8}, ::Bool, ::Float64, ::Bool, ::Bool, ::Bool, ::Bool, ::Nothing, ::Type, ::Base.GenericIOBuffer{Array{UInt8,1}}) at /home/travis/.julia/packages/CSV/2IO2Z/src/CSV.jl:232
   [5] Type at ./none:0 [inlined]
   [6] (::getfield(RDatasets, Symbol("##1#2")))(::IOStream) at /home/travis/build/johnmyleswhite/RDatasets.jl/src/dataset.jl:28
   [7] #open#294(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::getfield(RDatasets, Symbol("##1#2")), ::String, ::Vararg{String,N} where N) at ./iostream.jl:369
   [8] open at ./iostream.jl:367 [inlined]
   [9] dataset(::String, ::String) at /home/travis/build/johnmyleswhite/RDatasets.jl/src/dataset.jl:26
quinnj commented 5 years ago

@asinghvi17, I have a PR to CSV.jl which should fix the COUNT/affairs dataset reading (tested locally by me): https://github.com/JuliaData/CSV.jl/pull/423

asinghvi17 commented 5 years ago

@quinnj are there plans to tag a CSV release after that?

quinnj commented 5 years ago

Sorry for the slow response; hopefully you saw the new 0.5.1 CSV.jl release.

asinghvi17 commented 5 years ago

Closing to restart CI.

asinghvi17 commented 5 years ago

Fail is now due to Dates, CSV works @quinnj

asinghvi17 commented 5 years ago

It seems like gap::PD dataset is a problem here. I don't know what's being parsed as a Date...

asinghvi17 commented 5 years ago

Maybe the lab column is being parsed as a Date? Can we tell CSV not to do that explicitly, or is that something for Parsers.jl?

bjarthur commented 5 years ago

it is being parsed as a Date. you have to use the types kwarg to tell it to explicitly treat it as a String. i've actually been unknowingly working on this in parallel. see https://github.com/johnmyleswhite/RDatasets.jl/pull/70

bjarthur commented 5 years ago

also @quinnj : what was the reason for dropping julia 0.7 support in CSV? nominally if it works for julia 1, should work for julia 0.7 too, no?

randyzwitch commented 5 years ago

I think this was superseded by #70 , but I'll leave to @asinghvi17 to close this.

asinghvi17 commented 5 years ago

Yep, looks like that fixed it. Thanks!

asinghvi17 commented 5 years ago

Also, it would be nice to tag a new release :)