diff --git a/src/utils.jl b/src/utils.jl index c13bf223..9a794788 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -7,7 +7,12 @@ # but in HardMissing case, we don't; we know the column will *always* be Missing struct HardMissing end -willdrop!(columns, i) = setfield!(@inbounds(columns[i]), :willdrop, true) +function willdrop!(columns, i) + @inbounds col = columns[i] + col.willdrop = true + col.type = HardMissing + return +end struct NeedsTypeDetection end diff --git a/test/basics.jl b/test/basics.jl index 461fd3b5..b237bb22 100644 --- a/test/basics.jl +++ b/test/basics.jl @@ -725,4 +725,13 @@ f = CSV.File(joinpath(dir, "multithreadedpromote.csv")) @test eltype(f.col1) == String7 @test length(f) == 5001 +# 942 +data = """ +name, age +Jack, 12 +Tom, 10 +""" +f = CSV.File(IOBuffer(data); select=[2], type=Int32) + + end