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

"writeshortest not defined" on macOS #1065

Closed
ahalwright opened this issue Dec 26, 2022 · 1 comment
Closed

"writeshortest not defined" on macOS #1065

ahalwright opened this issue Dec 26, 2022 · 1 comment

Comments

@ahalwright
Copy link

ahalwright commented Dec 26, 2022

When I CSV.write a dataframe with a Float64 column, I get a "writeshortest not defined" error. The problem may be with the Parsers package.

julia> df = DataFrame( :a=>rand(Float64,2))
2×1 DataFrame
Row │ a
│ Float64
─────┼──────────
1 │ 0.823397
2 │ 0.226439
julia> f = open("test.csv","w")
IOStream()
julia> CSV.write(f,df)
ERROR: UndefVarError: writeshortest not defined
Stacktrace:
[1] writecell(buf::Vector{UInt8}, pos::Int64, len::Int64, io::IOStream, 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, IOStream, 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::IOStream, sch::Tables.Schema{(:a,), 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{(:a,), Tuple{Float64}}, DataFrames.DataFrameRows{DataFrame}, CSV.Options{UInt8, UInt8, Nothing, Tuple{}, typeof(CSV._identity)}, Vector{UInt8}, Int64, Int64, Tuple{Symbol}})(io::IOStream)
@ CSV ~/.julia/packages/CSV/jFiCn/src/write.jl:235
[6] with(f::CSV.var"#99#100"{Bool, Bool, Tables.Schema{(:a,), 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::IOStream, 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::IOStream, itr::DataFrame)
@ CSV ~/.julia/packages/CSV/jFiCn/src/write.jl:153
[10] top-level scope
@ REPL[372]:1

julia> versioninfo()
Julia Version 1.8.3
Commit 0434deb161e (2022-11-14 20:14 UTC)
Platform Info:
OS: macOS (arm64-apple-darwin21.3.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

@quinnj
Copy link
Member

quinnj commented Jan 3, 2023

You need to update your Parsers.jl version; it shouldn't be possible to have incompatible versions of CSV + Parsers together, but I believe under certain system image scenarios, they can get out of sync.

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