-
Notifications
You must be signed in to change notification settings - Fork 142
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
UndefVarError: writeshortest not defined
on CSV.write
#1056
Comments
This is specific to some old versions of CSV.jl (e.g., v0.9.11); it's trying to use MWE by Seb-MC on Discourse(@v1.8) pkg> activate --temp
...
(jl_cOmpJF) pkg> add CSV@v0.9.11
...
(jl_cOmpJF) pkg> add DataFrames
...
julia> using DataFrames, CSV
julia> cd(mktempdir())
julia> df = DataFrame(:a=>rand(3))
3×1 DataFrame
Row │ a
│ Float64
─────┼──────────
1 │ 0.100739
2 │ 0.346434
3 │ 0.657864
julia> CSV.write("a.csv", 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 C:\Users\sebastian\.julia\packages\CSV\9LsxT\src\write.jl:444
[2] (::CSV.var"#112#113"{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 C:\Users\sebastian\.julia\packages\CSV\9LsxT\src\write.jl:371
[3] eachcolumn
@ C:\Users\sebastian\.julia\packages\Tables\T7rHm\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 C:\Users\sebastian\.julia\packages\CSV\9LsxT\src\write.jl:367
[5] (::CSV.var"#105#106"{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 C:\Users\sebastian\.julia\packages\CSV\9LsxT\src\write.jl:235
[6] with(f::CSV.var"#105#106"{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 C:\Users\sebastian\.julia\packages\CSV\9LsxT\src\write.jl:303
[7] #write#104
@ C:\Users\sebastian\.julia\packages\CSV\9LsxT\src\write.jl:225 [inlined]
[8] write(file::String, 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 C:\Users\sebastian\.julia\packages\CSV\9LsxT\src\write.jl:210
[9] write(file::String, itr::DataFrame)
@ CSV C:\Users\sebastian\.julia\packages\CSV\9LsxT\src\write.jl:153
[10] top-level scope
@ REPL[9]:1 A quick and dirty hotpatch is to do an: @eval CSV.Parsers import Base.Ryu: writeshortest |
Could we maybe have a patch release to v0.9 that ensures the parsers compat is correct? That minor version doesn't have such a pin Line 23 in 879f41b
|
If I install the latest versions of both |
@AraujoH are you sure you have the latest versions? This will happen if you have CSV <= v0.10.4 and Parsers >= v2.2.4, I believe. I've found both can often get held back by other packages. |
https://discourse.julialang.org/t/csv-write-writeshortest-error/90336
The text was updated successfully, but these errors were encountered: