From 678a1665b90db39cdb8dd60a4b572a10f50de4c8 Mon Sep 17 00:00:00 2001 From: Jonathan Keane Date: Fri, 2 May 2025 03:33:54 -0500 Subject: [PATCH 01/10] Don't specify helpers separately --- dev/tasks/r/github.linux.arrow.version.back.compat.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dev/tasks/r/github.linux.arrow.version.back.compat.yml b/dev/tasks/r/github.linux.arrow.version.back.compat.yml index fae8630d132..43c04a46e07 100644 --- a/dev/tasks/r/github.linux.arrow.version.back.compat.yml +++ b/dev/tasks/r/github.linux.arrow.version.back.compat.yml @@ -135,8 +135,7 @@ jobs: - name: Setup our testing directory, copy only the tests to it. run: | mkdir -p extra-tests/files - cp arrow/r/extra-tests/helper*.R extra-tests/ - cp arrow/r/extra-tests/test-*.R extra-tests/ + cp arrow/r/extra-tests/*.R extra-tests/ - name: Download artifacts uses: actions/download-artifact@v4 with: From a200063f91380bb2ae3b142e7ca5b4647ae2abc5 Mon Sep 17 00:00:00 2001 From: Jonathan Keane Date: Fri, 2 May 2025 03:51:03 -0500 Subject: [PATCH 02/10] Remove older arrow, change how we source our helpers --- ...github.linux.arrow.version.back.compat.yml | 26 +++---------------- r/extra-tests/test-read-files.R | 2 -- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/dev/tasks/r/github.linux.arrow.version.back.compat.yml b/dev/tasks/r/github.linux.arrow.version.back.compat.yml index 43c04a46e07..358d42af920 100644 --- a/dev/tasks/r/github.linux.arrow.version.back.compat.yml +++ b/dev/tasks/r/github.linux.arrow.version.back.compat.yml @@ -66,19 +66,7 @@ jobs: read-files: name: "Read files with Arrow {{ '${{ matrix.config.old_arrow_version }}' }}" needs: [write-files] - # condition && true-case || false-case - # == - # condition ? true-case : false-case - # - # We use Ubuntu 20.04 for 3.0.0 or earlier because 3.0.0 or - # earlier can't be built on Ubuntu 22.04. We will drop 3.0.0 or - # earlier when Ubuntu 20.04 is unavailable on GitHub Actions. - runs-on: >- - {{ "${{ (startsWith(matrix.config.old_arrow_version, '3.') || - startsWith(matrix.config.old_arrow_version, '2.') || - startsWith(matrix.config.old_arrow_version, '1.')) && - 'ubuntu-20.04' || - 'ubuntu-22.04' }}" }} + runs-on: 'ubuntu-22.04' strategy: fail-fast: false matrix: @@ -100,10 +88,7 @@ jobs: - { old_arrow_version: '7.0.0', r: '4.1' } - { old_arrow_version: '6.0.1', r: '4.1' } - { old_arrow_version: '5.0.0', r: '4.1' } - - { old_arrow_version: '4.0.0', r: '4.0' } - - { old_arrow_version: '3.0.0', r: '4.0' } - - { old_arrow_version: '2.0.0', r: '4.0' } - - { old_arrow_version: '1.0.1', r: '4.0' } + - { old_arrow_version: '4.0.0', r: '4.1' } env: ARROW_R_DEV: "TRUE" OLD_ARROW_VERSION: {{ '${{ matrix.config.old_arrow_version }}' }} @@ -118,11 +103,6 @@ jobs: # for 6.0.0 or later. rspm="https://packagemanager.rstudio.com/cran/__linux__/jammy/latest" echo "RSPM=${rspm}" >> $GITHUB_ENV - elif [ ${old_arrow_version_major} -le 3 ]; then - # We use Ubuntu 20.04 for 3.0.0 or earlier because 3.0.0 or earlier - # can't be built on Ubuntu 22.04. - rspm="https://packagemanager.rstudio.com/cran/__linux__/focal/latest" - echo "RSPM=${rspm}" >> $GITHUB_ENV fi - uses: r-lib/actions/setup-r@v2 with: @@ -135,6 +115,8 @@ jobs: - name: Setup our testing directory, copy only the tests to it. run: | mkdir -p extra-tests/files + # Move test helpers for e.g. skip_if_arrow_version_less_than() + cp arrow/r/tests/testthat/helper*.R extra-tests/ cp arrow/r/extra-tests/*.R extra-tests/ - name: Download artifacts uses: actions/download-artifact@v4 diff --git a/r/extra-tests/test-read-files.R b/r/extra-tests/test-read-files.R index 2f5db38e520..6c56659040b 100644 --- a/r/extra-tests/test-read-files.R +++ b/r/extra-tests/test-read-files.R @@ -18,8 +18,6 @@ library(arrow) library(testthat) -source("tests/testthat/helper-skip.R") - pq_file <- "files/ex_data.parquet" test_that("Can read the file (parquet)", { From 34cfd4f17c1a507aea70570da3ad97d2ce2be5ff Mon Sep 17 00:00:00 2001 From: Jonathan Keane Date: Fri, 2 May 2025 04:01:58 -0500 Subject: [PATCH 03/10] Limit what we move --- dev/tasks/r/github.linux.arrow.version.back.compat.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/tasks/r/github.linux.arrow.version.back.compat.yml b/dev/tasks/r/github.linux.arrow.version.back.compat.yml index 358d42af920..73c63bae2ff 100644 --- a/dev/tasks/r/github.linux.arrow.version.back.compat.yml +++ b/dev/tasks/r/github.linux.arrow.version.back.compat.yml @@ -115,8 +115,8 @@ jobs: - name: Setup our testing directory, copy only the tests to it. run: | mkdir -p extra-tests/files - # Move test helpers for e.g. skip_if_arrow_version_less_than() - cp arrow/r/tests/testthat/helper*.R extra-tests/ + # Move test helpers for skip_if_arrow_version_less_than() + cp arrow/r/tests/testthat/helper-skip.R extra-tests/ cp arrow/r/extra-tests/*.R extra-tests/ - name: Download artifacts uses: actions/download-artifact@v4 From 44dc655bb6ec42aaea0ce5da332531f34a6ebc3c Mon Sep 17 00:00:00 2001 From: Jonathan Keane Date: Fri, 2 May 2025 04:15:44 -0500 Subject: [PATCH 04/10] Just copy the helper --- .../r/github.linux.arrow.version.back.compat.yml | 2 -- r/extra-tests/test-read-files.R | 12 ++++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/dev/tasks/r/github.linux.arrow.version.back.compat.yml b/dev/tasks/r/github.linux.arrow.version.back.compat.yml index 73c63bae2ff..ecbea54ce49 100644 --- a/dev/tasks/r/github.linux.arrow.version.back.compat.yml +++ b/dev/tasks/r/github.linux.arrow.version.back.compat.yml @@ -115,8 +115,6 @@ jobs: - name: Setup our testing directory, copy only the tests to it. run: | mkdir -p extra-tests/files - # Move test helpers for skip_if_arrow_version_less_than() - cp arrow/r/tests/testthat/helper-skip.R extra-tests/ cp arrow/r/extra-tests/*.R extra-tests/ - name: Download artifacts uses: actions/download-artifact@v4 diff --git a/r/extra-tests/test-read-files.R b/r/extra-tests/test-read-files.R index 6c56659040b..b38bfd41aca 100644 --- a/r/extra-tests/test-read-files.R +++ b/r/extra-tests/test-read-files.R @@ -18,6 +18,18 @@ library(arrow) library(testthat) +# These are copied from tests/testthat/helper-skip.R so we don't need to load all of +# the helpers. +skip_if_arrow_version_less_than <- function(version, msg) { + if (arrow_cpp_version() < numeric_version(version)) { + skip(msg) + } +} + +arrow_cpp_version <- function() { + numeric_version(gsub("-SNAPSHOT", "", arrow::arrow_info()$build_info["cpp_version"])) +} + pq_file <- "files/ex_data.parquet" test_that("Can read the file (parquet)", { From 3136979f3576eca8387b8782dd3151dc34481c74 Mon Sep 17 00:00:00 2001 From: Jonathan Keane Date: Fri, 2 May 2025 04:27:59 -0500 Subject: [PATCH 05/10] One more extra function --- r/extra-tests/test-read-files.R | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/r/extra-tests/test-read-files.R b/r/extra-tests/test-read-files.R index b38bfd41aca..66c31bd31b4 100644 --- a/r/extra-tests/test-read-files.R +++ b/r/extra-tests/test-read-files.R @@ -20,12 +20,20 @@ library(testthat) # These are copied from tests/testthat/helper-skip.R so we don't need to load all of # the helpers. +if_version_less_than <- function(version) { + arrow_cpp_version() < numeric_version(version) +} + skip_if_arrow_version_less_than <- function(version, msg) { - if (arrow_cpp_version() < numeric_version(version)) { + if (if_version_less_than(version)) { skip(msg) } } +if_version_less_than <- function(version) { + arrow_cpp_version() < numeric_version(version) +} + arrow_cpp_version <- function() { numeric_version(gsub("-SNAPSHOT", "", arrow::arrow_info()$build_info["cpp_version"])) } From a0b4ad0d8e09482674b07a8f2ced153290053406 Mon Sep 17 00:00:00 2001 From: Jonathan Keane Date: Fri, 2 May 2025 07:35:24 -0500 Subject: [PATCH 06/10] Actually, we need a different function --- r/extra-tests/test-read-files.R | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/r/extra-tests/test-read-files.R b/r/extra-tests/test-read-files.R index 66c31bd31b4..4d4ecf85faf 100644 --- a/r/extra-tests/test-read-files.R +++ b/r/extra-tests/test-read-files.R @@ -18,24 +18,20 @@ library(arrow) library(testthat) -# These are copied from tests/testthat/helper-skip.R so we don't need to load all of -# the helpers. -if_version_less_than <- function(version) { - arrow_cpp_version() < numeric_version(version) -} - -skip_if_arrow_version_less_than <- function(version, msg) { - if (if_version_less_than(version)) { - skip(msg) - } +# These are similar to functions in tests/testthat/helper-skip.R but we duplicate them +# here since very old versions don't have arrow_info() with exactly the same shape +if_version <- function(version, op = `==`) { + op(packageVersion("arrow"), version) } if_version_less_than <- function(version) { - arrow_cpp_version() < numeric_version(version) + if_version(version, op = `<`) } -arrow_cpp_version <- function() { - numeric_version(gsub("-SNAPSHOT", "", arrow::arrow_info()$build_info["cpp_version"])) +skip_if_version_less_than <- function(version, msg) { + if (if_version(version, `<`)) { + skip(msg) + } } pq_file <- "files/ex_data.parquet" @@ -50,7 +46,7 @@ test_that("Can read the file (parquet)", { ### Parquet test_that("Can see the metadata (parquet)", { - skip_if_arrow_version_less_than("2.0.0", "Version 1.0.1 can't read new version metadata.") + skip_if_version_less_than("2.0.0", "Version 1.0.1 can't read new version metadata.") df <- read_parquet(pq_file) expect_s3_class(df, "tbl") @@ -94,7 +90,7 @@ for (comp in c("lz4", "uncompressed", "zstd")) { }) test_that(paste0("Can see the metadata (feather ", comp, ")"), { - skip_if_arrow_version_less_than("2.0.0", "Version 1.0.1 can't read new version metadata.") + skip_if_version_less_than("2.0.0", "Version 1.0.1 can't read new version metadata.") df <- read_feather(feather_file) expect_s3_class(df, "tbl") @@ -152,7 +148,7 @@ test_that("Can read the file (parquet)", { }) test_that("Can see the metadata (stream)", { - skip_if_arrow_version_less_than("2.0.0", "Version 1.0.1 can't read new version metadata.") + skip_if_version_less_than("2.0.0", "Version 1.0.1 can't read new version metadata.") df <- read_ipc_stream(stream_file) expect_s3_class(df, "tbl") From 4d67ee3ba8466d46a17a1b8e8c9484717f5dd436 Mon Sep 17 00:00:00 2001 From: Jonathan Keane Date: Fri, 2 May 2025 07:53:18 -0500 Subject: [PATCH 07/10] Remove extraneous skips --- r/tests/testthat/helper-skip.R | 16 ---------------- r/tests/testthat/test-compute-arith.R | 4 ---- r/tests/testthat/test-dplyr-funcs-math.R | 4 ---- 3 files changed, 24 deletions(-) diff --git a/r/tests/testthat/helper-skip.R b/r/tests/testthat/helper-skip.R index fdfe152d6ee..eb69fb55dc4 100644 --- a/r/tests/testthat/helper-skip.R +++ b/r/tests/testthat/helper-skip.R @@ -130,22 +130,6 @@ skip_on_python_older_than <- function(python_version) { } } -skip_if_arrow_version_less_than <- function(version, msg) { - if (arrow_cpp_version() < numeric_version(version)) { - skip(msg) - } -} - -skip_if_arrow_version_equals <- function(version, msg) { - if (arrow_cpp_version() == numeric_version(version)) { - skip(msg) - } -} - -arrow_cpp_version <- function() { - numeric_version(gsub("-SNAPSHOT", "", arrow::arrow_info()$build_info["cpp_version"])) -} - process_is_running <- function(x) { if (force_tests()) { # Return TRUE as this is used as a condition in an if statement diff --git a/r/tests/testthat/test-compute-arith.R b/r/tests/testthat/test-compute-arith.R index 602e718b71c..7d77b33f262 100644 --- a/r/tests/testthat/test-compute-arith.R +++ b/r/tests/testthat/test-compute-arith.R @@ -235,8 +235,6 @@ test_that("Math group generics work on Array objects", { }) test_that("hyperbolic trig functions work on Array objects", { - skip_if_arrow_version_less_than("18.1.0.9000", "Hyperbolic trig functions not available until version 19.") - expect_equal(sinh(Array$create(c(0.6, 0.9))), Array$create(sinh(c(0.6, 0.9)))) expect_equal(cosh(Array$create(c(0.6, 0.9))), Array$create(cosh(c(0.6, 0.9)))) expect_equal(tanh(Array$create(c(0.6, 0.9))), Array$create(tanh(c(0.6, 0.9)))) @@ -248,7 +246,5 @@ test_that("hyperbolic trig functions work on Array objects", { }) test_that("expm1 works on Array objects", { - skip_if_arrow_version_less_than("18.1.0.9000", "expm1 not available until version 19.") - expect_equal(expm1(Array$create(c(0.00000001, 10))), Array$create(expm1(c(0.00000001, 10)))) }) diff --git a/r/tests/testthat/test-dplyr-funcs-math.R b/r/tests/testthat/test-dplyr-funcs-math.R index 07fab645e7b..e2b622cdb6e 100644 --- a/r/tests/testthat/test-dplyr-funcs-math.R +++ b/r/tests/testthat/test-dplyr-funcs-math.R @@ -339,8 +339,6 @@ test_that("trig functions", { }) test_that("hyperbolic trig functions", { - skip_if_arrow_version_less_than("18.1.0.9000", "Hyperbolic trig functions not available until version 19.") - # Note: We change df mid-test because domains differ by function df <- tibble(x = c(seq(from = 0, to = 1, by = 0.1), NA)) @@ -495,8 +493,6 @@ test_that("sqrt()", { }) test_that("expm1()", { - skip_if_arrow_version_less_than("18.1.0.9000", "`expm1()` not available until version 19.") - df <- tibble(x = c(1:5)) compare_dplyr_binding( From f6c0bdb15301c1f811cbc53c659bb4e317c7eefa Mon Sep 17 00:00:00 2001 From: Jonathan Keane Date: Fri, 2 May 2025 09:20:33 -0500 Subject: [PATCH 08/10] Bump required version higher --- .github/workflows/r.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml index 80dd30335f8..9c2e20f511d 100644 --- a/.github/workflows/r.yml +++ b/.github/workflows/r.yml @@ -64,13 +64,11 @@ env: jobs: ubuntu-minimum-cpp-version: name: Check minimum supported Arrow C++ Version (${{ matrix.cpp_version }}) - # We don't provide Apache Arrow C++ 15.0.2 deb packages for Ubuntu 24.04. - # So we use ubuntu-22.04 here. - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest strategy: matrix: include: - - cpp_version: "15.0.2" + - cpp_version: "19.0.1" steps: - name: Checkout Arrow uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 From 120c0f6861190270b4b5360d8d2006de8bed90ce Mon Sep 17 00:00:00 2001 From: Jonathan Keane Date: Fri, 2 May 2025 09:39:27 -0500 Subject: [PATCH 09/10] Need to install R --- .github/workflows/r.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml index 9c2e20f511d..bed012325d3 100644 --- a/.github/workflows/r.yml +++ b/.github/workflows/r.yml @@ -96,7 +96,6 @@ jobs: - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - install-r: false - uses: r-lib/actions/setup-r-dependencies@v2 with: From 6af8167f7ac22b2f84347761b2fd8f5932d6b122 Mon Sep 17 00:00:00 2001 From: Jonathan Keane Date: Fri, 2 May 2025 12:55:53 -0500 Subject: [PATCH 10/10] Ugh go back to 22.04? --- .github/workflows/r.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml index bed012325d3..01cd2b1250d 100644 --- a/.github/workflows/r.yml +++ b/.github/workflows/r.yml @@ -64,7 +64,7 @@ env: jobs: ubuntu-minimum-cpp-version: name: Check minimum supported Arrow C++ Version (${{ matrix.cpp_version }}) - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: include: @@ -96,6 +96,7 @@ jobs: - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true + install-r: false - uses: r-lib/actions/setup-r-dependencies@v2 with: