This is an automated email from the ASF dual-hosted git repository.

thisisnic pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new d14c10b8ce GH-37431: [R] Tests failing for R versions < 4.0 because of 
use of base pipe (|>) in tests (#37432)
d14c10b8ce is described below

commit d14c10b8ced99d5b87ebdb390138301736f55070
Author: Nic Crane <[email protected]>
AuthorDate: Thu Aug 31 16:51:34 2023 +0100

    GH-37431: [R] Tests failing for R versions < 4.0 because of use of base 
pipe (|>) in tests (#37432)
    
    ### Rationale for this change
    
    Nightly builds using R versions < 4.0 fail due usage of newer syntax
    
    ### What changes are included in this PR?
    
    Use older syntax
    
    ### Are these changes tested?
    
    No
    
    ### Are there any user-facing changes?
    
    No
    * Closes: #37431
    
    Authored-by: Nic Crane <[email protected]>
    Signed-off-by: Nic Crane <[email protected]>
---
 r/tests/testthat/test-dataset-write.R | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/r/tests/testthat/test-dataset-write.R 
b/r/tests/testthat/test-dataset-write.R
index e2c3c68b50..28ff308747 100644
--- a/r/tests/testthat/test-dataset-write.R
+++ b/r/tests/testthat/test-dataset-write.R
@@ -945,7 +945,7 @@ test_that("Dataset can write flat files using 
readr::write_csv() options.", {
   dst_dir <- make_temp_dir()
   write_dataset(df, dst_dir, format = "csv", quoting_style = "AllValid")
   ds <- open_dataset(dst_dir, format = "csv")
-  expect_equal(df, ds |> collect())
+  expect_equal(df, ds %>% collect())
 
   lines <- paste(readLines(paste0(dst_dir, "/part-0.csv")), sep = "\n")
   expect_equal(lines[2], "\"1\",\"1\",\"true\",\"a\"")
@@ -995,7 +995,7 @@ test_that("Dataset write wrappers can write flat files 
using readr::write_csv()
   dst_dir <- make_temp_dir()
   write_csv_dataset(df, dst_dir, quote = "all", delim = ";")
   ds <- open_dataset(dst_dir, format = "csv", delim = ";")
-  expect_equal(df, ds |> collect())
+  expect_equal(df, ds %>% collect())
 
   lines <- paste(readLines(paste0(dst_dir, "/part-0.csv")), sep = "\n")
   expect_equal(lines[2], "\"1\";\"1\";\"true\";\"a\"")
@@ -1003,13 +1003,13 @@ test_that("Dataset write wrappers can write flat files 
using readr::write_csv()
   dst_dir <- make_temp_dir()
   write_tsv_dataset(df, dst_dir, quote = "all", eol = "\r\n")
   ds <- open_dataset(dst_dir, format = "tsv")
-  expect_equal(df, ds |> collect())
+  expect_equal(df, ds %>% collect())
 
   lines <- paste(readLines(paste0(dst_dir, "/part-0.tsv")), sep = "\n")
   expect_equal(lines[2], "\"1\"\t\"1\"\t\"true\"\t\"a\"")
   dst_dir <- make_temp_dir()
   write_tsv_dataset(df, dst_dir, na = "NOVALUE")
-  ds <- open_dataset(dst_dir, format = "tsv") |> collect()
+  ds <- open_dataset(dst_dir, format = "tsv") %>% collect()
 
   expect_equal(
     ds$lgl,

Reply via email to