thisisnic commented on a change in pull request #11432:
URL: https://github.com/apache/arrow/pull/11432#discussion_r732613289
##########
File path: r/R/util.R
##########
@@ -193,3 +193,16 @@ repeat_value_as_array <- function(object, n) {
}
return(Scalar$create(object)$as_array(n))
}
+
+handle_csv_read_error <- function(e, schema) {
+ msg <- conditionMessage(e)
+
+ if (grepl("conversion error", msg) && inherits(schema, "Schema")) {
+ abort(c(
+ msg,
+ i = "Did you check your CSV file doesn't have a header row?"
Review comment:
I think this could still use some rephrasing to point the user in the
right direction. How about something like "if your data contains a header row,
you should use `skip=1` to prevent reading it in as data"?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]