jonkeane commented on a change in pull request #11432:
URL: https://github.com/apache/arrow/pull/11432#discussion_r738568620
##########
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 = "If you have supplied a schema and your data contains a header row,
you should supply the argument `skip = 1` to prevent the header being read in
as data."
Review comment:
Could you break this line up so that it's shorter + passes the linter?
--
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]