Skip to content

Commit

Permalink
ARROW-16073: [R] clean-up date time unit testing once tzdb is availab…
Browse files Browse the repository at this point in the history
…le on Windows

Closes #12883 from dragosmg/datetime_unit_testing_cleanup

Authored-by: Dragoș Moldovan-Grünfeld <dragos.mold@gmail.com>
Signed-off-by: Jonathan Keane <jkeane@gmail.com>
  • Loading branch information
dragosmg authored and jonkeane committed Apr 29, 2022
1 parent 48a6e25 commit 3c03d49
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 0 additions & 5 deletions r/tests/testthat/test-dplyr-funcs-datetime.R
Original file line number Diff line number Diff line change
Expand Up @@ -841,8 +841,6 @@ test_that("month() supports integer input", {
test_df_month
)

skip_on_os("windows") # https://issues.apache.org/jira/browse/ARROW-13168

compare_dplyr_binding(
.input %>%
# R returns ordered factor whereas Arrow returns character
Expand Down Expand Up @@ -904,8 +902,6 @@ test_that("month() errors with double input and returns NA with int outside 1:12
})

test_that("date works in arrow", {
# https://issues.apache.org/jira/browse/ARROW-13168
skip_on_os("windows")
# this date is specific since lubridate::date() is different from base::as.Date()
# since as.Date returns the UTC date and date() doesn't
test_df <- tibble(
Expand Down Expand Up @@ -1123,7 +1119,6 @@ test_that("difftime works correctly", {
ignore_attr = TRUE
)

skip_on_os("windows")
test_df_with_tz <- tibble(
time1 = as.POSIXct(
c("2021-02-20", "2021-07-31", "2021-10-30", "2021-01-31"),
Expand Down
7 changes: 5 additions & 2 deletions r/tests/testthat/test-dplyr-funcs-type.R
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,6 @@ test_that("`as.Date()` and `as_date()`", {
fixed = TRUE
)


# we do not support as.Date() with double/ float (error surfaced from C++)
# TODO revisit after https://issues.apache.org/jira/browse/ARROW-15798
expect_error(
Expand Down Expand Up @@ -958,7 +957,11 @@ test_that("`as_datetime()`", {
})

test_that("format date/time", {
skip_on_os("windows") # https://issues.apache.org/jira/browse/ARROW-13168
# locale issues
# TODO revisit after https://issues.apache.org/jira/browse/ARROW-16399 is done
if (tolower(Sys.info()[["sysname"]]) == "windows") {
withr::local_locale(LC_TIME = "C")
}
# In 3.4 the lack of tzone attribute causes spurious failures
skip_if_r_version("3.4.4")

Expand Down

0 comments on commit 3c03d49

Please sign in to comment.