paleolimbot commented on a change in pull request #11592:
URL: https://github.com/apache/arrow/pull/11592#discussion_r743028399



##########
File path: r/R/dplyr-functions.R
##########
@@ -848,6 +844,21 @@ nse_funcs$wday <- function(x,
   Expression$create("day_of_week", x, options = list(count_from_zero = FALSE, 
week_start = week_start))
 }
 
+nse_funcs$is.Date <- function(x) {
+  inherits(x, "Date") ||
+    (inherits(x, "Expression") && x$type_id() %in% Type[c("DATE32")])
+}
+
+nse_funcs$is.instant <- nse_funcs$is.timepoint <- function(x) {
+  inherits(x, c("POSIXt", "Date")) ||

Review comment:
       Good catch!

##########
File path: r/R/dplyr-functions.R
##########
@@ -848,6 +844,21 @@ nse_funcs$wday <- function(x,
   Expression$create("day_of_week", x, options = list(count_from_zero = FALSE, 
week_start = week_start))
 }
 
+nse_funcs$is.Date <- function(x) {
+  inherits(x, "Date") ||
+    (inherits(x, "Expression") && x$type_id() %in% Type[c("DATE32")])
+}
+
+nse_funcs$is.instant <- nse_funcs$is.timepoint <- function(x) {
+  inherits(x, c("POSIXt", "POSIXct", "POSIXlt", "Date")) ||
+    (inherits(x, "Expression") && x$type_id() %in% Type[c("TIMESTAMP", 
"DATE32")])
+}
+
+nse_funcs$is.POSIXct <- function(x) {
+  inherits(x, "POSIXct") ||
+    (inherits(x, "Expression") && x$type_id() %in% Type[c("TIMESTAMP")])
+}
+

Review comment:
       @jonkeane and I chatted about that earlier in thie PR...I think it could 
be added but only if the POSIXlt class was converted to Arrow as a timestamp 
(currently it gets converted to a struct). Otherwise I think it's too hard to 
pay off here (do you detect a very specific struct type?).




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