You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/12/08 13:23:30 UTC

[GitHub] [arrow] romainfrancois commented on a change in pull request #11898: ARROW-14844_decimal256_take2

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



##########
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:
       oh good point. Maybe casting automatically is not such a good idea then. 




-- 
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-unsubscribe@arrow.apache.org

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