Skip to content

Commit

Permalink
Improve error message for CSV.read(source)
Browse files Browse the repository at this point in the history
  • Loading branch information
nalimilan authored Nov 15, 2020
1 parent d2197f0 commit 6e304ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/CSV.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Read and parses a delimited file, materializing directly using the `sink` functi
"""
function read(source, sink=nothing; copycols::Bool=false, kwargs...)
if sink === nothing
throw(ArgumentError("provide a valid sink argument, like `CSV.read(source, DataFrame)`"))
throw(ArgumentError("provide a valid sink argument, like `using DataFrames; CSV.read(source, DataFrame)`"))
end
Tables.CopiedColumns(CSV.File(source; kwargs...)) |> sink
end
Expand Down

0 comments on commit 6e304ba

Please sign in to comment.