Skip to content

Commit

Permalink
updated unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dragosmg committed Mar 21, 2022
1 parent 5039694 commit d474053
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions r/tests/testthat/test-dplyr-funcs-datetime.R
Expand Up @@ -996,16 +996,6 @@ test_that("difftime()", {
ignore_attr = TRUE
)

compare_dplyr_binding(
.input %>%
mutate(
secs2 = difftime(as.POSIXct("2022-03-07"), time1, units = "secs")
) %>%
collect(),
test_df,
ignore_attr = TRUE
)

# units other than "secs" not supported in arrow
compare_dplyr_binding(
.input %>%
Expand All @@ -1022,11 +1012,11 @@ test_that("difftime()", {
test_df_with_tz <- tibble(
time1 = as.POSIXct(
c("2021-02-20", "2021-07-31", "2021-10-30", "2021-01-31"),
tz = "Europe/London"
tz = "Pacific/Marquesas"
),
time2 = as.POSIXct(
c("2021-02-20 00:02:01", "2021-07-31 00:03:54", "2021-10-30 00:05:45", "2021-01-31 00:07:36"),
tz = "America/Chicago"
tz = "Asia/Kathmandu"
),
secs = c(121L, 234L, 345L, 456L)
)
Expand Down Expand Up @@ -1057,7 +1047,7 @@ test_that("difftime()", {
mutate(secs2 = difftime(time2, time1, units = "secs", tz = "Pacific/Marquesas")) %>%
collect(),
test_df_with_tz,
warning = "`tz` is an optional argument"
warning = "`tz` argument is not supported in Arrow, so it will be ignored"
)
})

Expand Down Expand Up @@ -1110,8 +1100,9 @@ test_that("as.difftime()", {
warning = TRUE
)

# only integer (or integer-like) -> duration supported in Arrow.
# double -> duration not supported
# only integer (or integer-like) -> duration conversion supported in Arrow.
# double -> duration not supported. we're not testing the content of the
# error message as it is being generated in the C++ code and it might change
expect_error(
test_df %>%
arrow_table() %>%
Expand Down

0 comments on commit d474053

Please sign in to comment.