Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions r/NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* `lubridate`:
* `tz()` to extract/get timezone
* `semester()` to extract/get semester
* `dst()` to get daylight savings time indicator.

# arrow 7.0.0

Expand Down
1 change: 1 addition & 0 deletions r/R/expression.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@

# date and time functions
"day" = "day",
"dst" = "is_dst",
"hour" = "hour",
"isoweek" = "iso_week",
"epiweek" = "us_week",
Expand Down
15 changes: 15 additions & 0 deletions r/tests/testthat/test-dplyr-funcs-datetime.R
Original file line number Diff line number Diff line change
Expand Up @@ -784,5 +784,20 @@ test_that("semester works with temporal types and integers", {
collect(),
regexp = "NotImplemented: Function 'month' has no kernel matching input types (array[string])",
fixed = TRUE
)
})

test_that("dst extracts daylight savings time correctly", {
test_df <- tibble(
dates = as.POSIXct(c("2021-02-20", "2021-07-31", "2021-10-31", "2021-01-31"), tz = "Europe/London")
)
# https://issues.apache.org/jira/browse/ARROW-13168
skip_on_os("windows")

compare_dplyr_binding(
.input %>%
mutate(dst = dst(dates)) %>%
collect(),
test_df
)
})