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



##########
File path: r/R/dplyr-funcs-datetime.R
##########
@@ -147,5 +147,12 @@ register_bindings_datetime <- function() {
   register_binding("pm", function(x) {
     !call_binding("am", x)
   })
-
+  register_binding("tz", function(x) {
+    if (call_binding("is.character", x) ||
+        call_binding("is.Date", x)) {
+      return("UTC")
+    } else {
+      return(x$type()$timezone())
+    }

Review comment:
       We could go back to my first variant, which was also the simplest:
   ```r
     register_binding("tz", function(x) {
         x$type()$timezone()
     })
   ```
   
   I can't figure out how to surface an error from `tz()` as it gets caught by 
the dplyr query and then the dplyr-equivalent expression still gets evaluated 
in R.




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