dragosmg commented on a change in pull request #11898:
URL: https://github.com/apache/arrow/pull/11898#discussion_r764728144



##########
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:
       Would this be considered a fix for 
[ARROW-11631](https://issues.apache.org/jira/browse/ARROW-11631)?
   As @romainfrancois indicated 
https://github.com/apache/arrow/pull/11805#issuecomment-985352985 this would 
allow to create Arrays directly.




-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to