You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/03/09 14:59:55 UTC

[GitHub] [arrow] jorisvandenbossche commented on a change in pull request #12589: ARROW-14848 [R] Implement bindings for lubridate's parse_date_time, parse_date_time2, and fast_strptime

jorisvandenbossche commented on a change in pull request #12589:
URL: https://github.com/apache/arrow/pull/12589#discussion_r822740289



##########
File path: r/R/dplyr-funcs-datetime.R
##########
@@ -167,4 +167,33 @@ register_bindings_datetime <- function() {
   register_binding("date", function(x) {
     build_expr("cast", x, options = list(to_type = date32()))
   })
+  register_binding("fast_strptime", function(x,
+                                             format,
+                                             tz = "UTC",
+                                             lt = TRUE,
+                                             cutoff_2000 = 68L,
+                                             unit = "s") {
+    if (!missing(tz)) {
+      arrow_not_supported("Time zone argument")
+    }
+    # `lt` controls the output `lt = TRUE` returns a POSIXlt (which doesn't play
+    # well with mutate, for example)
+    if (lt) {
+      arrow_not_supported("`lt = TRUE` argument")
+    }
+
+    if (cutoff_2000 != 68L) {
+      arrow_not_supported("`cutoff_2000` != 68L argument")
+    }
+
+    # the strptime kernel does not support scalar strings => if we want to be

Review comment:
       In python it does:
   
   ```
   >>> pc.strptime("2022-03-05", format="%Y-%m-%d", unit="us")
   <pyarrow.TimestampScalar: datetime.datetime(2022, 3, 5, 0, 0)>
   ```
   
   so is this an R specific limitation?




-- 
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: github-unsubscribe@arrow.apache.org

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