thisisnic commented on a change in pull request #11432:
URL: https://github.com/apache/arrow/pull/11432#discussion_r732816840
##########
File path: r/R/util.R
##########
@@ -193,3 +193,17 @@ 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 your data contains a header row, you should use skip = 1 to
+ prevent reading it in as data."
Review comment:
```suggestion
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."
```
--
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]