dragosmg commented on code in PR #12589:
URL: https://github.com/apache/arrow/pull/12589#discussion_r861858300
##########
r/R/dplyr-funcs-datetime.R:
##########
@@ -357,6 +357,62 @@ register_bindings_duration <- function() {
delta <- delta$cast(int64())
start + delta$cast(duration("s"))
})
+ register_binding("fast_strptime", function(x,
+ format,
+ tz = "UTC",
+ lt = TRUE,
+ cutoff_2000 = 68L,
+ unit = "s") {
+ # TODO support multiple formats once
+ # https://issues.apache.org/jira/browse/ARROW-15665 is done
+ if (length(format) > 1) {
+ arrow_not_supported("multiple values for `format`")
+ }
+
+ 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")
+ }
+
+ unit <- make_valid_time_unit(unit, c(valid_time64_units,
valid_time32_units))
+
+ build_expr("strptime", x, options = list(format = format, unit = unit))
Review Comment:
Done.
--
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]