dragosmg opened a new pull request #12431:
URL: https://github.com/apache/arrow/pull/12431
This PR adds support for `lubridate::dst()`:
``` r
suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(lubridate))
suppressPackageStartupMessages(library(arrow))
df <- tibble(
dates = as.POSIXct(c("2021-02-20", "2021-07-31", "2021-10-31",
"2021-01-31"), tz = "Europe/London")
)
df %>%
record_batch() %>%
mutate(is_dst = dst(dates)) %>%
collect()
#> # A tibble: 4 × 2
#> dates is_dst
#> <dttm> <lgl>
#> 1 2021-02-20 00:00:00 FALSE
#> 2 2021-07-31 00:00:00 TRUE
#> 3 2021-10-31 00:00:00 TRUE
#> 4 2021-01-31 00:00:00 FALSE
```
will be equivalent to:
``` r
suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(lubridate))
df <- tibble(
dates = as.POSIXct(c("2021-02-20", "2021-07-31", "2021-10-31",
"2021-01-31"), tz = "Europe/London")
)
df %>%
mutate(is_dst = dst(dates))
#> # A tibble: 4 × 2
#> dates is_dst
#> <dttm> <lgl>
#> 1 2021-02-20 00:00:00 FALSE
#> 2 2021-07-31 00:00:00 TRUE
#> 3 2021-10-31 00:00:00 TRUE
#> 4 2021-01-31 00:00:00 FALSE
```
<sup>Created on 2022-02-15 by the [reprex
package](https://reprex.tidyverse.org) (v2.0.1)</sup>
--
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]