diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml index 80dd30335f8..01cd2b1250d 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 strategy: matrix: include: - - cpp_version: "15.0.2" + - cpp_version: "19.0.1" steps: - name: Checkout Arrow uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 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..ecbea54ce49 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,8 +115,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: diff --git a/r/extra-tests/test-read-files.R b/r/extra-tests/test-read-files.R index 2f5db38e520..4d4ecf85faf 100644 --- a/r/extra-tests/test-read-files.R +++ b/r/extra-tests/test-read-files.R @@ -18,7 +18,21 @@ library(arrow) library(testthat) -source("tests/testthat/helper-skip.R") +# 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) { + if_version(version, op = `<`) +} + +skip_if_version_less_than <- function(version, msg) { + if (if_version(version, `<`)) { + skip(msg) + } +} pq_file <- "files/ex_data.parquet" @@ -32,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") @@ -76,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") @@ -134,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") 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(