jonkeane commented on a change in pull request #12357:
URL: https://github.com/apache/arrow/pull/12357#discussion_r804164292



##########
File path: r/tests/testthat/_snaps/dplyr-funcs-datetime.md
##########
@@ -0,0 +1,15 @@
+# extract tz
+
+    Code
+      compare_dplyr_binding(.input %>% mutate(timezone_y = tz(x), timezone_z = 
tz(z),
+      timezone_w = tz(w), timezone_v = tz(v)) %>% collect(), df)
+    Warning <simpleWarning>
+      tz(): Don't know how to compute timezone for object of class integer; 
returning "UTC". This warning will become an error in the next major version of 
lubridate.
+      tz(): Don't know how to compute timezone for object of class numeric; 
returning "UTC". This warning will become an error in the next major version of 
lubridate.
+      tz(): Don't know how to compute timezone for object of class integer; 
returning "UTC". This warning will become an error in the next major version of 
lubridate.
+      tz(): Don't know how to compute timezone for object of class numeric; 
returning "UTC". This warning will become an error in the next major version of 
lubridate.
+    Error <expectation_failure>
+      `via_batch <- rlang::eval_tidy(expr, 
rlang::new_data_mask(rlang::env(.input = record_batch(tbl))))` threw an 
unexpected warning.
+      Message: Expression tz(z) not supported in Arrow; pulling data into R

Review comment:
       > Thanks for your comments. On surfacing errors: for example, I used 
abort() when working out how to implement format() 
(https://github.com/dragosmg/arrow/blob/9c99c03d4bdd5b80dea8acf88a3949808662bd32/r/R/dplyr-funcs-type.R#L259),
 but that error never surfaces as it is intercepted by the mutate() "context" 
and data is pulled into R.
   
   Yup, that's expected, this message right here (at the front before `not 
supported in Arrow; pulling data into R` is the error message that I was asking 
about when I asked "What happens if you call this binding on an integer or a 
float?" 
   
   I believe this is ultimately coming from 
https://github.com/apache/arrow/blob/fa699117091917f0992225aff4e8d4c08910162a/r/R/dplyr-eval.R#L58
 
   
   which might not be the best message. If we `abort()` when we get types we 
know won't work we might be able to give a bit more informative errors than 
`Expression tz(z) not supported`




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


Reply via email to