jorisvandenbossche commented on code in PR #35671:
URL: https://github.com/apache/arrow/pull/35671#discussion_r1205376906
##########
r/R/dplyr-funcs-datetime.R:
##########
@@ -61,12 +61,14 @@ register_bindings_datetime_utility <- function() {
tz <- Sys.timezone()
}
- # if a timestamp does not contain timezone information (i.e. it is
+ # If a timestamp does not contain timezone information (i.e. it is
# "timezone-naive") we can attach timezone information (i.e. convert it
into
# a "timezone-aware" timestamp) with `assume_timezone`
# if we want to cast to a different timezone, we can only do it for
- # timezone-aware timestamps, not for timezone-naive ones
- if (!is.null(tz)) {
+ # timezone-aware timestamps, not for timezone-naive ones.
+ # strptime in Acero will return a timezone-aware timestamp if %z is
+ # part of the format string.
+ if (!is.null(tz) && !grepl("%z", format, fixed = TRUE)) {
Review Comment:
> It's a good point that this doesn't match what base R does...I think we'd
want to `cast()` if `grepl("%z")` and `assume_timezone()` otherwise?
Yes, that sounds correct
--
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]