jonkeane commented on a change in pull request #11898:
URL: https://github.com/apache/arrow/pull/11898#discussion_r768060546
##########
File path: r/R/array.R
##########
@@ -187,7 +187,18 @@ Array$create <- function(x, type = NULL) {
}
return(out)
}
- vec_to_Array(x, type)
+ tryCatch(
+ vec_to_Array(x, type),
+ error = function(cnd) {
+ if (!is.null(type)) {
+ # try again and then cast
+ vec_to_Array(x, NULL)$cast(type)
+ } else {
+ signalCondition(cnd)
+ }
+ }
+ )
+
Review comment:
Ah, sorry what I meant by "this message isn't great" is that having to
have a (stop) message here isn't the best UI (but we're deferring ARROW-11631
since it's not trivial), so this is the next best thing.
The content of the message proposed here is good, it's clear + actionable
and better than having people stuck like they are now.
--
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]