From fe207dfc9c8d9b59bbee7053fa2a85571462e998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Moldovan-Gr=C3=BCnfeld?= Date: Thu, 14 Apr 2022 13:28:02 +0300 Subject: [PATCH 01/24] un-skipped some of the tests on windows --- r/tests/testthat/test-dplyr-funcs-datetime.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/r/tests/testthat/test-dplyr-funcs-datetime.R b/r/tests/testthat/test-dplyr-funcs-datetime.R index a4c5ee3c224..b540b58474c 100644 --- a/r/tests/testthat/test-dplyr-funcs-datetime.R +++ b/r/tests/testthat/test-dplyr-funcs-datetime.R @@ -841,7 +841,7 @@ test_that("month() supports integer input", { test_df_month ) - skip_on_os("windows") # https://issues.apache.org/jira/browse/ARROW-13168 + # skip_on_os("windows") # https://issues.apache.org/jira/browse/ARROW-13168 compare_dplyr_binding( .input %>% @@ -905,7 +905,7 @@ 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") + # 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( @@ -1123,7 +1123,7 @@ test_that("difftime works correctly", { ignore_attr = TRUE ) - skip_on_os("windows") + # 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"), From 8d6f015d3f79ccd3fb3d566706c6344a1c0c7208 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Moldovan-Gr=C3=BCnfeld?= Date: Thu, 14 Apr 2022 14:02:38 +0300 Subject: [PATCH 02/24] 2nd pass --- r/tests/testthat/test-dplyr-funcs-type.R | 1 + 1 file changed, 1 insertion(+) diff --git a/r/tests/testthat/test-dplyr-funcs-type.R b/r/tests/testthat/test-dplyr-funcs-type.R index 6a07d36e818..1bfaaa67996 100644 --- a/r/tests/testthat/test-dplyr-funcs-type.R +++ b/r/tests/testthat/test-dplyr-funcs-type.R @@ -897,6 +897,7 @@ test_that("`as.Date()` and `as_date()`", { # to `as.Date()` # `as_date()` does the opposite: uses the tzone attribute of the POSIXct object # passsed if`tz` is NULL + # skip_on_os("windows") # https://issues.apache.org/jira/browse/ARROW-13168 compare_dplyr_binding( .input %>% transmute( From 658b716968f696e498dab6f32ae99144790fc0e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Moldovan-Gr=C3=BCnfeld?= Date: Thu, 14 Apr 2022 18:43:07 +0300 Subject: [PATCH 03/24] trying something out --- r/tests/testthat/test-dplyr-funcs-type.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r/tests/testthat/test-dplyr-funcs-type.R b/r/tests/testthat/test-dplyr-funcs-type.R index 1bfaaa67996..278f8892c3e 100644 --- a/r/tests/testthat/test-dplyr-funcs-type.R +++ b/r/tests/testthat/test-dplyr-funcs-type.R @@ -967,7 +967,7 @@ test_that("format date/time", { datetime = c(lubridate::ymd_hms("2018-10-07 19:04:05", tz = "Pacific/Marquesas"), NA), date = c(as.Date("2021-01-01"), NA) ) - formats <- "%a %A %w %d %b %B %m %y %Y %H %I %p %M %z %Z %j %U %W %x %X %% %G %V %u" + formats <- "%a %A %w %d %m %y %Y %H %I %p %M %z %Z %j %U %W %x %X %% %G %V %u" formats_date <- "%a %A %w %d %b %B %m %y %Y %H %I %p %M %j %U %W %x %X %% %G %V %u" compare_dplyr_binding( From fc7dfb658abfd8ef09674aa5c6efa0a449c50e4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Moldovan-Gr=C3=BCnfeld?= Date: Thu, 21 Apr 2022 16:53:17 +0100 Subject: [PATCH 04/24] test --- r/tests/testthat/test-dplyr-funcs-datetime.R | 6 +++--- r/tests/testthat/test-dplyr-funcs-type.R | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/r/tests/testthat/test-dplyr-funcs-datetime.R b/r/tests/testthat/test-dplyr-funcs-datetime.R index b540b58474c..cf398db96a6 100644 --- a/r/tests/testthat/test-dplyr-funcs-datetime.R +++ b/r/tests/testthat/test-dplyr-funcs-datetime.R @@ -841,7 +841,7 @@ test_that("month() supports integer input", { test_df_month ) - # skip_on_os("windows") # https://issues.apache.org/jira/browse/ARROW-13168 + # test skip_on_os("windows") # https://issues.apache.org/jira/browse/ARROW-13168 compare_dplyr_binding( .input %>% @@ -905,7 +905,7 @@ 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") + # test 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( @@ -1123,7 +1123,7 @@ test_that("difftime works correctly", { ignore_attr = TRUE ) - # skip_on_os("windows") + # test 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"), diff --git a/r/tests/testthat/test-dplyr-funcs-type.R b/r/tests/testthat/test-dplyr-funcs-type.R index 278f8892c3e..401acc5770a 100644 --- a/r/tests/testthat/test-dplyr-funcs-type.R +++ b/r/tests/testthat/test-dplyr-funcs-type.R @@ -959,7 +959,7 @@ test_that("`as_datetime()`", { }) test_that("format date/time", { - skip_on_os("windows") # https://issues.apache.org/jira/browse/ARROW-13168 + # test skip_on_os("windows") # https://issues.apache.org/jira/browse/ARROW-13168 # In 3.4 the lack of tzone attribute causes spurious failures skip_if_r_version("3.4.4") @@ -967,7 +967,7 @@ test_that("format date/time", { datetime = c(lubridate::ymd_hms("2018-10-07 19:04:05", tz = "Pacific/Marquesas"), NA), date = c(as.Date("2021-01-01"), NA) ) - formats <- "%a %A %w %d %m %y %Y %H %I %p %M %z %Z %j %U %W %x %X %% %G %V %u" + formats <- "%a %A %w %d %b %B %m %y %Y %H %I %p %M %z %Z %j %U %W %x %X %% %G %V %u" formats_date <- "%a %A %w %d %b %B %m %y %Y %H %I %p %M %j %U %W %x %X %% %G %V %u" compare_dplyr_binding( From 06ba19efde01ea5db12dc69d1812c593e7361d2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Moldovan-Gr=C3=BCnfeld?= Date: Tue, 26 Apr 2022 09:11:14 +0100 Subject: [PATCH 05/24] removed `%B` from `formats` --- r/tests/testthat/test-dplyr-funcs-type.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r/tests/testthat/test-dplyr-funcs-type.R b/r/tests/testthat/test-dplyr-funcs-type.R index 401acc5770a..00148db37fd 100644 --- a/r/tests/testthat/test-dplyr-funcs-type.R +++ b/r/tests/testthat/test-dplyr-funcs-type.R @@ -967,7 +967,7 @@ test_that("format date/time", { datetime = c(lubridate::ymd_hms("2018-10-07 19:04:05", tz = "Pacific/Marquesas"), NA), date = c(as.Date("2021-01-01"), NA) ) - formats <- "%a %A %w %d %b %B %m %y %Y %H %I %p %M %z %Z %j %U %W %x %X %% %G %V %u" + formats <- "%a %A %w %d %b %m %y %Y %H %I %p %M %z %Z %j %U %W %x %X %% %G %V %u" formats_date <- "%a %A %w %d %b %B %m %y %Y %H %I %p %M %j %U %W %x %X %% %G %V %u" compare_dplyr_binding( From 71b8ecb87377c678240bb91b794201607091d3ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Moldovan-Gr=C3=BCnfeld?= Date: Tue, 26 Apr 2022 09:21:55 +0100 Subject: [PATCH 06/24] tidy-up after rebase --- r/tests/testthat/test-dplyr-funcs-type.R | 1 - 1 file changed, 1 deletion(-) diff --git a/r/tests/testthat/test-dplyr-funcs-type.R b/r/tests/testthat/test-dplyr-funcs-type.R index 00148db37fd..ff763b0c173 100644 --- a/r/tests/testthat/test-dplyr-funcs-type.R +++ b/r/tests/testthat/test-dplyr-funcs-type.R @@ -897,7 +897,6 @@ test_that("`as.Date()` and `as_date()`", { # to `as.Date()` # `as_date()` does the opposite: uses the tzone attribute of the POSIXct object # passsed if`tz` is NULL - # skip_on_os("windows") # https://issues.apache.org/jira/browse/ARROW-13168 compare_dplyr_binding( .input %>% transmute( From 830eabd1f39c7542b60769bb7e0f9d75ecab44dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Moldovan-Gr=C3=BCnfeld?= Date: Tue, 26 Apr 2022 09:30:52 +0100 Subject: [PATCH 07/24] removed empty row --- r/tests/testthat/test-dplyr-funcs-type.R | 1 - 1 file changed, 1 deletion(-) diff --git a/r/tests/testthat/test-dplyr-funcs-type.R b/r/tests/testthat/test-dplyr-funcs-type.R index ff763b0c173..7a92df8f233 100644 --- a/r/tests/testthat/test-dplyr-funcs-type.R +++ b/r/tests/testthat/test-dplyr-funcs-type.R @@ -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( From 2ad706e615292ece2a2eeafdf8ef7b00a28e8873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Moldovan-Gr=C3=BCnfeld?= Date: Tue, 26 Apr 2022 10:04:54 +0100 Subject: [PATCH 08/24] removed `"%b"` from formats --- r/tests/testthat/test-dplyr-funcs-type.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r/tests/testthat/test-dplyr-funcs-type.R b/r/tests/testthat/test-dplyr-funcs-type.R index 7a92df8f233..5ec554805d6 100644 --- a/r/tests/testthat/test-dplyr-funcs-type.R +++ b/r/tests/testthat/test-dplyr-funcs-type.R @@ -965,7 +965,7 @@ test_that("format date/time", { datetime = c(lubridate::ymd_hms("2018-10-07 19:04:05", tz = "Pacific/Marquesas"), NA), date = c(as.Date("2021-01-01"), NA) ) - formats <- "%a %A %w %d %b %m %y %Y %H %I %p %M %z %Z %j %U %W %x %X %% %G %V %u" + formats <- "%a %A %w %d %m %y %Y %H %I %p %M %z %Z %j %U %W %x %X %% %G %V %u" formats_date <- "%a %A %w %d %b %B %m %y %Y %H %I %p %M %j %U %W %x %X %% %G %V %u" compare_dplyr_binding( From 2720ae48d3294d4f38d3c6c3f6e0a8c1cfbf1b03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Moldovan-Gr=C3=BCnfeld?= Date: Tue, 26 Apr 2022 10:59:24 +0100 Subject: [PATCH 09/24] removed `"%a"` & `"%A"` --- r/tests/testthat/test-dplyr-funcs-type.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r/tests/testthat/test-dplyr-funcs-type.R b/r/tests/testthat/test-dplyr-funcs-type.R index 5ec554805d6..4df10ac9ecc 100644 --- a/r/tests/testthat/test-dplyr-funcs-type.R +++ b/r/tests/testthat/test-dplyr-funcs-type.R @@ -965,7 +965,7 @@ test_that("format date/time", { datetime = c(lubridate::ymd_hms("2018-10-07 19:04:05", tz = "Pacific/Marquesas"), NA), date = c(as.Date("2021-01-01"), NA) ) - formats <- "%a %A %w %d %m %y %Y %H %I %p %M %z %Z %j %U %W %x %X %% %G %V %u" + formats <- "%w %d %m %y %Y %H %I %p %M %z %Z %j %U %W %x %X %% %G %V %u" formats_date <- "%a %A %w %d %b %B %m %y %Y %H %I %p %M %j %U %W %x %X %% %G %V %u" compare_dplyr_binding( From 54672d7ec69028dad4d623e66eb962cb09441a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Moldovan-Gr=C3=BCnfeld?= Date: Tue, 26 Apr 2022 11:46:33 +0100 Subject: [PATCH 10/24] park the formats skipped on Windows --- r/tests/testthat/test-dplyr-funcs-type.R | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/r/tests/testthat/test-dplyr-funcs-type.R b/r/tests/testthat/test-dplyr-funcs-type.R index 4df10ac9ecc..7272074f75b 100644 --- a/r/tests/testthat/test-dplyr-funcs-type.R +++ b/r/tests/testthat/test-dplyr-funcs-type.R @@ -1035,6 +1035,16 @@ test_that("format date/time", { ) } ) + + skip_on_os("windows") # locale issues + formats_skipped_on_windows <- "%a %A %b %B" + + compare_dplyr_binding( + .input %>% + mutate(x = format(datetime, format = formats_skipped_on_windows)) %>% + collect(), + times + ) }) test_that("format() for unsupported types returns the input as string", { From 797e4d77980dfcf250e529c636aa6cb3ff2901e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Moldovan-Gr=C3=BCnfeld?= Date: Tue, 26 Apr 2022 13:33:32 +0100 Subject: [PATCH 11/24] move `"%p"` to `formats_skipped_on_windows` --- r/tests/testthat/test-dplyr-funcs-type.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/r/tests/testthat/test-dplyr-funcs-type.R b/r/tests/testthat/test-dplyr-funcs-type.R index 7272074f75b..5a56a3802e4 100644 --- a/r/tests/testthat/test-dplyr-funcs-type.R +++ b/r/tests/testthat/test-dplyr-funcs-type.R @@ -965,7 +965,7 @@ test_that("format date/time", { datetime = c(lubridate::ymd_hms("2018-10-07 19:04:05", tz = "Pacific/Marquesas"), NA), date = c(as.Date("2021-01-01"), NA) ) - formats <- "%w %d %m %y %Y %H %I %p %M %z %Z %j %U %W %x %X %% %G %V %u" + formats <- "%w %d %m %y %Y %H %I %M %z %Z %j %U %W %x %X %% %G %V %u" formats_date <- "%a %A %w %d %b %B %m %y %Y %H %I %p %M %j %U %W %x %X %% %G %V %u" compare_dplyr_binding( @@ -1037,7 +1037,7 @@ test_that("format date/time", { ) skip_on_os("windows") # locale issues - formats_skipped_on_windows <- "%a %A %b %B" + formats_skipped_on_windows <- "%a %A %b %B %p" compare_dplyr_binding( .input %>% From 5d623685d22c6ef30555967b7575ffb3243a649c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Moldovan-Gr=C3=BCnfeld?= Date: Tue, 26 Apr 2022 14:13:58 +0100 Subject: [PATCH 12/24] skipping the `"%x"` & `"%X"` formats on Windows --- r/tests/testthat/test-dplyr-funcs-type.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/r/tests/testthat/test-dplyr-funcs-type.R b/r/tests/testthat/test-dplyr-funcs-type.R index 5a56a3802e4..16a685ee7e0 100644 --- a/r/tests/testthat/test-dplyr-funcs-type.R +++ b/r/tests/testthat/test-dplyr-funcs-type.R @@ -965,7 +965,7 @@ test_that("format date/time", { datetime = c(lubridate::ymd_hms("2018-10-07 19:04:05", tz = "Pacific/Marquesas"), NA), date = c(as.Date("2021-01-01"), NA) ) - formats <- "%w %d %m %y %Y %H %I %M %z %Z %j %U %W %x %X %% %G %V %u" + formats <- "%w %d %m %y %Y %H %I %M %z %Z %j %U %W %% %G %V %u" formats_date <- "%a %A %w %d %b %B %m %y %Y %H %I %p %M %j %U %W %x %X %% %G %V %u" compare_dplyr_binding( @@ -1037,7 +1037,7 @@ test_that("format date/time", { ) skip_on_os("windows") # locale issues - formats_skipped_on_windows <- "%a %A %b %B %p" + formats_skipped_on_windows <- "%a %A %b %B %p %x %X" compare_dplyr_binding( .input %>% From f63a2ef7a9f6ee7a62892bbf8fcbae99be26fe49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Moldovan-Gr=C3=BCnfeld?= Date: Tue, 26 Apr 2022 14:57:34 +0100 Subject: [PATCH 13/24] test without formats --- r/tests/testthat/test-dplyr-funcs-type.R | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/r/tests/testthat/test-dplyr-funcs-type.R b/r/tests/testthat/test-dplyr-funcs-type.R index 16a685ee7e0..636feeb2b85 100644 --- a/r/tests/testthat/test-dplyr-funcs-type.R +++ b/r/tests/testthat/test-dplyr-funcs-type.R @@ -968,12 +968,12 @@ test_that("format date/time", { formats <- "%w %d %m %y %Y %H %I %M %z %Z %j %U %W %% %G %V %u" formats_date <- "%a %A %w %d %b %B %m %y %Y %H %I %p %M %j %U %W %x %X %% %G %V %u" - compare_dplyr_binding( - .input %>% - mutate(x = format(datetime, format = formats)) %>% - collect(), - times - ) + # test compare_dplyr_binding( + # test .input %>% + # test mutate(x = format(datetime, format = formats)) %>% + # test collect(), + # test times + # test ) compare_dplyr_binding( .input %>% From ed9b1f56c088130c2039de073866c04b1b7f270c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Moldovan-Gr=C3=BCnfeld?= Date: Tue, 26 Apr 2022 15:51:58 +0100 Subject: [PATCH 14/24] one more test --- r/tests/testthat/test-dplyr-funcs-type.R | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/r/tests/testthat/test-dplyr-funcs-type.R b/r/tests/testthat/test-dplyr-funcs-type.R index 636feeb2b85..1235083799a 100644 --- a/r/tests/testthat/test-dplyr-funcs-type.R +++ b/r/tests/testthat/test-dplyr-funcs-type.R @@ -975,12 +975,12 @@ test_that("format date/time", { # test times # test ) - compare_dplyr_binding( - .input %>% - mutate(x = format(date, format = formats_date)) %>% - collect(), - times - ) + # test compare_dplyr_binding( + # test .input %>% + # test mutate(x = format(date, format = formats_date)) %>% + # test collect(), + # test times + # test ) compare_dplyr_binding( .input %>% From 3119eb1e16d8dede36c9863050f4a98838f57f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Moldovan-Gr=C3=BCnfeld?= Date: Wed, 27 Apr 2022 14:33:51 +0100 Subject: [PATCH 15/24] another test --- r/tests/testthat/test-dplyr-funcs-type.R | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/r/tests/testthat/test-dplyr-funcs-type.R b/r/tests/testthat/test-dplyr-funcs-type.R index 1235083799a..bf1bba38645 100644 --- a/r/tests/testthat/test-dplyr-funcs-type.R +++ b/r/tests/testthat/test-dplyr-funcs-type.R @@ -982,12 +982,12 @@ test_that("format date/time", { # test times # test ) - compare_dplyr_binding( - .input %>% - mutate(x = format(datetime, format = formats, tz = "Europe/Bucharest")) %>% - collect(), - times - ) + # testcompare_dplyr_binding( + # test .input %>% + # test mutate(x = format(datetime, format = formats, tz = "Europe/Bucharest")) %>% + # test collect(), + # test times + # test) compare_dplyr_binding( .input %>% From d3abcc3a92d61b3c995f9ff7088e452cf757b910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Moldovan-Gr=C3=BCnfeld?= Date: Wed, 27 Apr 2022 15:22:51 +0100 Subject: [PATCH 16/24] another one --- r/tests/testthat/test-dplyr-funcs-type.R | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/r/tests/testthat/test-dplyr-funcs-type.R b/r/tests/testthat/test-dplyr-funcs-type.R index bf1bba38645..95a39ff8f46 100644 --- a/r/tests/testthat/test-dplyr-funcs-type.R +++ b/r/tests/testthat/test-dplyr-funcs-type.R @@ -989,12 +989,12 @@ test_that("format date/time", { # test times # test) - compare_dplyr_binding( - .input %>% - mutate(x = format(datetime, format = formats, tz = "EST", usetz = TRUE)) %>% - collect(), - times - ) + # testcompare_dplyr_binding( + # test .input %>% + # test mutate(x = format(datetime, format = formats, tz = "EST", usetz = TRUE)) %>% + # test collect(), + # test times + # test) compare_dplyr_binding( .input %>% From e87733b2f281d4bd1643f4d75c2ee655212e0f58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Moldovan-Gr=C3=BCnfeld?= Date: Wed, 27 Apr 2022 16:18:27 +0100 Subject: [PATCH 17/24] skip all tests with `format` --- r/tests/testthat/test-dplyr-funcs-type.R | 68 ++++++++++-------------- 1 file changed, 29 insertions(+), 39 deletions(-) diff --git a/r/tests/testthat/test-dplyr-funcs-type.R b/r/tests/testthat/test-dplyr-funcs-type.R index 95a39ff8f46..ef52610a701 100644 --- a/r/tests/testthat/test-dplyr-funcs-type.R +++ b/r/tests/testthat/test-dplyr-funcs-type.R @@ -957,7 +957,7 @@ test_that("`as_datetime()`", { }) test_that("format date/time", { - # test skip_on_os("windows") # https://issues.apache.org/jira/browse/ARROW-13168 + skip_on_os("windows") # https://issues.apache.org/jira/browse/ARROW-13168 + locale issues # In 3.4 the lack of tzone attribute causes spurious failures skip_if_r_version("3.4.4") @@ -965,36 +965,36 @@ test_that("format date/time", { datetime = c(lubridate::ymd_hms("2018-10-07 19:04:05", tz = "Pacific/Marquesas"), NA), date = c(as.Date("2021-01-01"), NA) ) - formats <- "%w %d %m %y %Y %H %I %M %z %Z %j %U %W %% %G %V %u" + formats <- "%a %A %w %d %b %B %m %y %Y %H %I %p %M %z %Z %j %U %W %x %X%% %G %V %u" formats_date <- "%a %A %w %d %b %B %m %y %Y %H %I %p %M %j %U %W %x %X %% %G %V %u" - # test compare_dplyr_binding( - # test .input %>% - # test mutate(x = format(datetime, format = formats)) %>% - # test collect(), - # test times - # test ) - - # test compare_dplyr_binding( - # test .input %>% - # test mutate(x = format(date, format = formats_date)) %>% - # test collect(), - # test times - # test ) - - # testcompare_dplyr_binding( - # test .input %>% - # test mutate(x = format(datetime, format = formats, tz = "Europe/Bucharest")) %>% - # test collect(), - # test times - # test) - - # testcompare_dplyr_binding( - # test .input %>% - # test mutate(x = format(datetime, format = formats, tz = "EST", usetz = TRUE)) %>% - # test collect(), - # test times - # test) + compare_dplyr_binding( + .input %>% + mutate(x = format(datetime, format = formats)) %>% + collect(), + times + ) + + compare_dplyr_binding( + .input %>% + mutate(x = format(date, format = formats_date)) %>% + collect(), + times + ) + + compare_dplyr_binding( + .input %>% + mutate(x = format(datetime, format = formats, tz = "Europe/Bucharest")) %>% + collect(), + times + ) + + compare_dplyr_binding( + .input %>% + mutate(x = format(datetime, format = formats, tz = "EST", usetz = TRUE)) %>% + collect(), + times + ) compare_dplyr_binding( .input %>% @@ -1035,16 +1035,6 @@ test_that("format date/time", { ) } ) - - skip_on_os("windows") # locale issues - formats_skipped_on_windows <- "%a %A %b %B %p %x %X" - - compare_dplyr_binding( - .input %>% - mutate(x = format(datetime, format = formats_skipped_on_windows)) %>% - collect(), - times - ) }) test_that("format() for unsupported types returns the input as string", { From 633f682e9bd75d9105e6cf7c74428eb6df834e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Moldovan-Gr=C3=BCnfeld?= Date: Thu, 28 Apr 2022 09:34:19 +0100 Subject: [PATCH 18/24] typo --- r/tests/testthat/test-dplyr-funcs-type.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r/tests/testthat/test-dplyr-funcs-type.R b/r/tests/testthat/test-dplyr-funcs-type.R index ef52610a701..549d7299132 100644 --- a/r/tests/testthat/test-dplyr-funcs-type.R +++ b/r/tests/testthat/test-dplyr-funcs-type.R @@ -965,7 +965,7 @@ test_that("format date/time", { datetime = c(lubridate::ymd_hms("2018-10-07 19:04:05", tz = "Pacific/Marquesas"), NA), date = c(as.Date("2021-01-01"), NA) ) - formats <- "%a %A %w %d %b %B %m %y %Y %H %I %p %M %z %Z %j %U %W %x %X%% %G %V %u" + formats <- "%a %A %w %d %b %B %m %y %Y %H %I %p %M %z %Z %j %U %W %x %X %% %G %V %u" formats_date <- "%a %A %w %d %b %B %m %y %Y %H %I %p %M %j %U %W %x %X %% %G %V %u" compare_dplyr_binding( From f6375677c967e14d0ef8f3fb70da5e57a7bc97dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Moldovan-Gr=C3=BCnfeld?= Date: Thu, 28 Apr 2022 09:37:21 +0100 Subject: [PATCH 19/24] removed commented-out `skip_on_os()` calls --- r/tests/testthat/test-dplyr-funcs-datetime.R | 5 ----- 1 file changed, 5 deletions(-) diff --git a/r/tests/testthat/test-dplyr-funcs-datetime.R b/r/tests/testthat/test-dplyr-funcs-datetime.R index cf398db96a6..47626a6cb19 100644 --- a/r/tests/testthat/test-dplyr-funcs-datetime.R +++ b/r/tests/testthat/test-dplyr-funcs-datetime.R @@ -841,8 +841,6 @@ test_that("month() supports integer input", { test_df_month ) - # test skip_on_os("windows") # https://issues.apache.org/jira/browse/ARROW-13168 - compare_dplyr_binding( .input %>% # R returns ordered factor whereas Arrow returns character @@ -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 - # test 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( @@ -1123,7 +1119,6 @@ test_that("difftime works correctly", { ignore_attr = TRUE ) - # test 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"), From b758c824eb4d2dc462833d4ac8f7774a78569672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Moldovan-Gr=C3=BCnfeld?= Date: Thu, 28 Apr 2022 13:29:38 +0100 Subject: [PATCH 20/24] added link to ARROW-13133 --- r/tests/testthat/test-dplyr-funcs-type.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/r/tests/testthat/test-dplyr-funcs-type.R b/r/tests/testthat/test-dplyr-funcs-type.R index 549d7299132..f3b9e130eb2 100644 --- a/r/tests/testthat/test-dplyr-funcs-type.R +++ b/r/tests/testthat/test-dplyr-funcs-type.R @@ -957,7 +957,8 @@ test_that("`as_datetime()`", { }) test_that("format date/time", { - skip_on_os("windows") # https://issues.apache.org/jira/browse/ARROW-13168 + locale issues + skip_on_os("windows") # https://issues.apache.org/jira/browse/ARROW-13168 + + # locale issues https://issues.apache.org/jira/browse/ARROW-13133 # In 3.4 the lack of tzone attribute causes spurious failures skip_if_r_version("3.4.4") From 521b3c1979938f38af970c364f6425e2c90db17c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Moldovan-Gr=C3=BCnfeld?= Date: Thu, 28 Apr 2022 15:36:06 +0100 Subject: [PATCH 21/24] set locale on windows to `"C"` --- r/tests/testthat/test-dplyr-funcs-type.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/r/tests/testthat/test-dplyr-funcs-type.R b/r/tests/testthat/test-dplyr-funcs-type.R index f3b9e130eb2..d06e0b18e31 100644 --- a/r/tests/testthat/test-dplyr-funcs-type.R +++ b/r/tests/testthat/test-dplyr-funcs-type.R @@ -957,8 +957,11 @@ test_that("`as_datetime()`", { }) test_that("format date/time", { - skip_on_os("windows") # https://issues.apache.org/jira/browse/ARROW-13168 + + # skip_on_os("windows") # https://issues.apache.org/jira/browse/ARROW-13168 + # locale issues https://issues.apache.org/jira/browse/ARROW-13133 + 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") From 79a9ac0af0e72fa96ce49cf2a2e06d9498b7dd48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Moldovan-Gr=C3=BCnfeld?= Date: Thu, 28 Apr 2022 17:24:54 +0100 Subject: [PATCH 22/24] test --- r/tests/testthat/test-dplyr-funcs-type.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r/tests/testthat/test-dplyr-funcs-type.R b/r/tests/testthat/test-dplyr-funcs-type.R index d06e0b18e31..51063f2fdd6 100644 --- a/r/tests/testthat/test-dplyr-funcs-type.R +++ b/r/tests/testthat/test-dplyr-funcs-type.R @@ -957,7 +957,7 @@ test_that("`as_datetime()`", { }) test_that("format date/time", { - # skip_on_os("windows") # https://issues.apache.org/jira/browse/ARROW-13168 + + # test skip_on_os("windows") # https://issues.apache.org/jira/browse/ARROW-13168 + # locale issues https://issues.apache.org/jira/browse/ARROW-13133 if (tolower(Sys.info()[["sysname"]]) == "windows") { withr::local_locale(LC_TIME = "C") From 3f27ba7d78455bcc16254241577a3dda4e677fed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Moldovan-Gr=C3=BCnfeld?= Date: Thu, 28 Apr 2022 17:52:30 +0100 Subject: [PATCH 23/24] refer to the correct Jira --- r/tests/testthat/test-dplyr-funcs-type.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/r/tests/testthat/test-dplyr-funcs-type.R b/r/tests/testthat/test-dplyr-funcs-type.R index 51063f2fdd6..89fdcd3d445 100644 --- a/r/tests/testthat/test-dplyr-funcs-type.R +++ b/r/tests/testthat/test-dplyr-funcs-type.R @@ -957,8 +957,8 @@ test_that("`as_datetime()`", { }) test_that("format date/time", { - # test skip_on_os("windows") # https://issues.apache.org/jira/browse/ARROW-13168 + - # locale issues https://issues.apache.org/jira/browse/ARROW-13133 + # locale issues + # TODO revisit once https://issues.apache.org/jira/browse/ARROW-16399 is done if (tolower(Sys.info()[["sysname"]]) == "windows") { withr::local_locale(LC_TIME = "C") } From c3b9c2bae9b9dc601d7e4cf92162fed2af74c8fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Moldovan-Gr=C3=BCnfeld?= Date: Thu, 28 Apr 2022 19:10:39 +0100 Subject: [PATCH 24/24] minor change --- r/tests/testthat/test-dplyr-funcs-type.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r/tests/testthat/test-dplyr-funcs-type.R b/r/tests/testthat/test-dplyr-funcs-type.R index 89fdcd3d445..e4283e39b59 100644 --- a/r/tests/testthat/test-dplyr-funcs-type.R +++ b/r/tests/testthat/test-dplyr-funcs-type.R @@ -958,7 +958,7 @@ test_that("`as_datetime()`", { test_that("format date/time", { # locale issues - # TODO revisit once https://issues.apache.org/jira/browse/ARROW-16399 is done + # 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") }