Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/r.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 3 additions & 24 deletions dev/tasks/r/github.linux.arrow.version.back.compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}' }}
Expand All @@ -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:
Expand All @@ -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:
Expand Down
22 changes: 18 additions & 4 deletions r/extra-tests/test-read-files.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down
16 changes: 0 additions & 16 deletions r/tests/testthat/helper-skip.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions r/tests/testthat/test-compute-arith.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))))
Expand All @@ -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))))
})
4 changes: 0 additions & 4 deletions r/tests/testthat/test-dplyr-funcs-math.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down Expand Up @@ -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(
Expand Down
Loading