CSV.jl icon indicating copy to clipboard operation
CSV.jl copied to clipboard

UndefVarError: writeshortest not defined

Open ahalwright opened this issue 2 years ago • 1 comments

Example on macOS (arm64-apple-darwin21.5.0) and on Generic Linux on x86 but not Windows.

Only occurs when dataframe includes a column of floats.

This issue was reported as fixed, but it isn't fixed.

using CSV, DataFrames dff = DataFrame(:i=>[1.2,2.0]) CSV.write(stdout,dff) ERROR: UndefVarError: writeshortest not defined Stacktrace: [1] writecell(buf::Vector{UInt8}, pos::Int64, len::Int64, io::Base.TTY, x::Float64, opts::CSV.Options{UInt8, UInt8, Nothing, Tuple{}, typeof(CSV._identity)}) @ CSV ~/.julia/packages/CSV/jFiCn/src/write.jl:444 [2] (::CSV.var"#106#107"{Vector{UInt8}, Base.RefValue{Int64}, Int64, Base.TTY, Int64, CSV.Options{UInt8, UInt8, Nothing, Tuple{}, typeof(CSV._identity)}, UInt8, UInt8})(val::Float64, col::Int64, nm::Symbol) @ CSV ~/.julia/packages/CSV/jFiCn/src/write.jl:371 [3] eachcolumn @ ~/.julia/packages/Tables/pLOVV/src/utils.jl:70 [inlined] [4] writerow(buf::Vector{UInt8}, pos::Base.RefValue{Int64}, len::Int64, io::Base.TTY, sch::Tables.Schema{(:i,), Tuple{Float64}}, row::DataFrameRow{DataFrame, DataFrames.Index}, cols::Int64, opts::CSV.Options{UInt8, UInt8, Nothing, Tuple{}, typeof(CSV._identity)}) @ CSV ~/.julia/packages/CSV/jFiCn/src/write.jl:367 [5] (::CSV.var"#99#100"{Bool, Bool, Tables.Schema{(:i,), Tuple{Float64}}, DataFrames.DataFrameRows{DataFrame}, CSV.Options{UInt8, UInt8, Nothing, Tuple{}, typeof(CSV._identity)}, Vector{UInt8}, Int64, Int64, Tuple{Symbol}})(io::Base.TTY) @ CSV ~/.julia/packages/CSV/jFiCn/src/write.jl:235 [6] with(f::CSV.var"#99#100"{Bool, Bool, Tables.Schema{(:i,), Tuple{Float64}}, DataFrames.DataFrameRows{DataFrame}, CSV.Options{UInt8, UInt8, Nothing, Tuple{}, typeof(CSV._identity)}, Vector{UInt8}, Int64, Int64, Tuple{Symbol}}, io::Any, append::Bool, compress::Bool) @ CSV ~/.julia/packages/CSV/jFiCn/src/write.jl:303 [7] #write#98 @ ~/.julia/packages/CSV/jFiCn/src/write.jl:225 [inlined] [8] write(file::Base.TTY, itr::DataFrame; delim::Char, quotechar::Char, openquotechar::Nothing, closequotechar::Nothing, escapechar::Char, newline::Char, decimal::Char, dateformat::Nothing, quotestrings::Bool, missingstring::String, transform::typeof(CSV._identity), bom::Bool, append::Bool, compress::Bool, writeheader::Nothing, partition::Bool, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}) @ CSV ~/.julia/packages/CSV/jFiCn/src/write.jl:210 [9] write(file::Base.TTY, itr::DataFrame) @ CSV ~/.julia/packages/CSV/jFiCn/src/write.jl:153 [10] top-level scope @ REPL[5]:1

versioninfo() Julia Version 1.8.5 Commit 17cfb8e65ea (2023-01-08 06:45 UTC) Platform Info: OS: macOS (arm64-apple-darwin21.5.0) CPU: 10 × Apple M1 Pro WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-13.0.1 (ORCJIT, apple-m1) Threads: 1 on 8 virtual cores

versioninfo() Julia Version 1.8.5 Commit 17cfb8e65ea (2023-01-08 06:45 UTC) Platform Info: OS: Linux (x86_64-linux-gnu) CPU: 24 × AMD Ryzen 9 3900X 12-Core Processor WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-13.0.1 (ORCJIT, znver2) Threads: 1 on 24 virtual cores

ahalwright avatar Jan 13 '23 22:01 ahalwright

I ran into this as well just now. For reference https://github.com/JuliaData/CSV.jl/issues/1065#issuecomment-1369808271 removing/adding Parsers.jl and CSV.jl may help. In most cases the manifest should probably not contain Parsers.jl eventually.

kafisatz avatar Jul 20 '23 06:07 kafisatz