From 57053c02d2c2d1d3edaa5f80003c61f85b17a562 Mon Sep 17 00:00:00 2001 From: Nic Crane Date: Wed, 14 May 2025 12:09:42 -0400 Subject: [PATCH 1/4] Add skip to trigger CI --- r/tests/testthat/test-dplyr-funcs-datetime.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/r/tests/testthat/test-dplyr-funcs-datetime.R b/r/tests/testthat/test-dplyr-funcs-datetime.R index a71ae721641..c06bcb927ea 100644 --- a/r/tests/testthat/test-dplyr-funcs-datetime.R +++ b/r/tests/testthat/test-dplyr-funcs-datetime.R @@ -3792,4 +3792,7 @@ test_that("hms::as_hms", { arrow_table(test_df) %>% mutate(y = hms::as_hms(dbl)) %>% collect(), "was truncated converting to int32" ) + + skip_if_not_available("utf8proc") + }) From 630d86da92e86ec3f0f41a649d80018fe1af34c5 Mon Sep 17 00:00:00 2001 From: Nic Crane Date: Wed, 14 May 2025 12:19:18 -0400 Subject: [PATCH 2/4] Skip tests requiring string parsing on builds without required libraries --- r/tests/testthat/test-dplyr-funcs-datetime.R | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/r/tests/testthat/test-dplyr-funcs-datetime.R b/r/tests/testthat/test-dplyr-funcs-datetime.R index c06bcb927ea..ea7e7de6340 100644 --- a/r/tests/testthat/test-dplyr-funcs-datetime.R +++ b/r/tests/testthat/test-dplyr-funcs-datetime.R @@ -3779,7 +3779,6 @@ test_that("hms::as_hms", { compare_dplyr_binding( .input %>% mutate( - x = hms::as_hms(hms_string), x2 = hms::as_hms(int), x3 = hms::as_hms(integerish_dbl), x4 = hms::as_hms(datetime) @@ -3795,4 +3794,13 @@ test_that("hms::as_hms", { skip_if_not_available("utf8proc") + compare_dplyr_binding( + .input %>% + mutate( + x = hms::as_hms(hms_string), + ) %>% + collect(), + test_df + ) + }) From 4a6ab04958e87e9f5d9852190e3a2a933e7cc225 Mon Sep 17 00:00:00 2001 From: Nic Crane Date: Wed, 14 May 2025 18:36:30 -0400 Subject: [PATCH 3/4] Add `origin` for pre R 4.3 compatibility --- r/tests/testthat/test-dplyr-funcs-datetime.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r/tests/testthat/test-dplyr-funcs-datetime.R b/r/tests/testthat/test-dplyr-funcs-datetime.R index ea7e7de6340..0a8c9fecde5 100644 --- a/r/tests/testthat/test-dplyr-funcs-datetime.R +++ b/r/tests/testthat/test-dplyr-funcs-datetime.R @@ -3773,7 +3773,7 @@ test_that("hms::as_hms", { int = c(30L, 75L), integerish_dbl = c(31, 76), dbl = c(31.2, 76.4), - datetime = as.POSIXct(c(1645243500, 1745243500), tz = "UTC") + datetime = as.POSIXct(c(1645243500, 1745243500), tz = "UTC", origin = "1970-01-01") ) compare_dplyr_binding( From 4dc5da14dd3d69fbe3e2af3c0912ee95e0496696 Mon Sep 17 00:00:00 2001 From: Nic Crane Date: Wed, 14 May 2025 18:38:31 -0400 Subject: [PATCH 4/4] Run styler --- r/tests/testthat/test-dplyr-funcs-datetime.R | 2 -- 1 file changed, 2 deletions(-) diff --git a/r/tests/testthat/test-dplyr-funcs-datetime.R b/r/tests/testthat/test-dplyr-funcs-datetime.R index 0a8c9fecde5..66ae0666232 100644 --- a/r/tests/testthat/test-dplyr-funcs-datetime.R +++ b/r/tests/testthat/test-dplyr-funcs-datetime.R @@ -3764,7 +3764,6 @@ test_that("hms::hms", { call_binding("hms::hms", seconds = NA), regexp = "All arguments must be numeric or NA_real_" ) - }) test_that("hms::as_hms", { @@ -3802,5 +3801,4 @@ test_that("hms::as_hms", { collect(), test_df ) - })