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



##########
File path: r/R/dplyr-functions.R
##########
@@ -255,6 +255,10 @@ nse_funcs$is_logical <- function(x, n = NULL) {
   assert_that(is.null(n))
   nse_funcs$is.logical(x)
 }
+nse_funcs$is_timestamp <- function(x, n = NULL) {
+  assert_that(is.null(n))
+  inherits(x, "POSIXt") || (inherits(x, "Expression") && x$type_id() %in% 
Type[c("TIMESTAMP")])
+}

Review comment:
       Yeah, that is a bit odd. There's also not a base `is.timestamp()` ASAIK 
(one could implement one there too, but I just needed this one).
   
   Though {lubridate} does have them:
   ```
   lubridate::is.Date
   lubridate::is.POSIXct
   lubridate::is.POSIXlt
   lubridate::is.POSIXt
   lubridate::is.difftime
   lubridate::is.duration
   lubridate::is.instant
   lubridate::is.interval
   lubridate::is.period
   lubridate::is.timepoint
   lubridate::is.timespan
   ```
   
   If we want to add these + add tests for this we can (though for now I'm 
going to make a ticket for that: 
https://issues.apache.org/jira/browse/ARROW-14227)




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