nealrichardson commented on a change in pull request #9952:
URL: https://github.com/apache/arrow/pull/9952#discussion_r610021701



##########
File path: r/R/arrow-datum.R
##########
@@ -22,6 +22,7 @@
 ArrowDatum <- R6Class("ArrowDatum", inherit = ArrowObject,
   public = list(
     cast = function(target_type, safe = TRUE, ...) {
+      target_type <- unmask_type_fun(enexpr(target_type)) %||% target_type

Review comment:
       I see you have this logic in `as_type` too; is that not enough? Seems 
like it would be best to encapsulate that complexity there somehow.

##########
File path: r/tests/testthat/test-dplyr.R
##########
@@ -421,12 +484,13 @@ test_that("explicit type conversions", {
         int2dbl = as.double(int),
         int2int = as.integer(int),
         int2lgl = as.logical(int),
-        lgl2chr = toupper(as.character(lgl)), # Arrow returns "true", "false"
+        lgl2chr = as.character(lgl), # Arrow returns "true", "false" here ...
         lgl2dbl = as.double(lgl),
         lgl2int = as.integer(lgl),
-        lgl2lgl = as.logical(lgl),
+        lgl2lgl = as.logical(lgl)
       ) %>%
-      collect(),
+      collect() %>%
+      mutate(lgl2chr = toupper(lgl2chr)), # ... but we need "TRUE", "FALSE"

Review comment:
       Can you add a comment explaining that?




-- 
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.

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


Reply via email to