Skip to content

Commit 81bb988

Browse files
authored
GH-46293: [R][CI] Backwards compatibility job updates (#46294)
### Rationale for this change Fix our compatibility jobs, also a bit of other cleanup ### What changes are included in this PR? CI fixes ### Are these changes tested? They are the tests ### Are there any user-facing changes? Nope * GitHub Issue: #46293
1 parent 62c59c2 commit 81bb988

6 files changed

Lines changed: 22 additions & 55 deletions

File tree

‎.github/workflows/r.yml‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,11 @@ env:
6464
jobs:
6565
ubuntu-minimum-cpp-version:
6666
name: Check minimum supported Arrow C++ Version (${{ matrix.cpp_version }})
67-
# We don't provide Apache Arrow C++ 15.0.2 deb packages for Ubuntu 24.04.
68-
# So we use ubuntu-22.04 here.
6967
runs-on: ubuntu-22.04
7068
strategy:
7169
matrix:
7270
include:
73-
- cpp_version: "15.0.2"
71+
- cpp_version: "19.0.1"
7472
steps:
7573
- name: Checkout Arrow
7674
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0

‎dev/tasks/r/github.linux.arrow.version.back.compat.yml‎

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,7 @@ jobs:
6666
read-files:
6767
name: "Read files with Arrow {{ '${{ matrix.config.old_arrow_version }}' }}"
6868
needs: [write-files]
69-
# condition && true-case || false-case
70-
# ==
71-
# condition ? true-case : false-case
72-
#
73-
# We use Ubuntu 20.04 for 3.0.0 or earlier because 3.0.0 or
74-
# earlier can't be built on Ubuntu 22.04. We will drop 3.0.0 or
75-
# earlier when Ubuntu 20.04 is unavailable on GitHub Actions.
76-
runs-on: >-
77-
{{ "${{ (startsWith(matrix.config.old_arrow_version, '3.') ||
78-
startsWith(matrix.config.old_arrow_version, '2.') ||
79-
startsWith(matrix.config.old_arrow_version, '1.')) &&
80-
'ubuntu-20.04' ||
81-
'ubuntu-22.04' }}" }}
69+
runs-on: 'ubuntu-22.04'
8270
strategy:
8371
fail-fast: false
8472
matrix:
@@ -100,10 +88,7 @@ jobs:
10088
- { old_arrow_version: '7.0.0', r: '4.1' }
10189
- { old_arrow_version: '6.0.1', r: '4.1' }
10290
- { old_arrow_version: '5.0.0', r: '4.1' }
103-
- { old_arrow_version: '4.0.0', r: '4.0' }
104-
- { old_arrow_version: '3.0.0', r: '4.0' }
105-
- { old_arrow_version: '2.0.0', r: '4.0' }
106-
- { old_arrow_version: '1.0.1', r: '4.0' }
91+
- { old_arrow_version: '4.0.0', r: '4.1' }
10792
env:
10893
ARROW_R_DEV: "TRUE"
10994
OLD_ARROW_VERSION: {{ '${{ matrix.config.old_arrow_version }}' }}
@@ -118,11 +103,6 @@ jobs:
118103
# for 6.0.0 or later.
119104
rspm="https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"
120105
echo "RSPM=${rspm}" >> $GITHUB_ENV
121-
elif [ ${old_arrow_version_major} -le 3 ]; then
122-
# We use Ubuntu 20.04 for 3.0.0 or earlier because 3.0.0 or earlier
123-
# can't be built on Ubuntu 22.04.
124-
rspm="https://packagemanager.rstudio.com/cran/__linux__/focal/latest"
125-
echo "RSPM=${rspm}" >> $GITHUB_ENV
126106
fi
127107
- uses: r-lib/actions/setup-r@v2
128108
with:
@@ -135,8 +115,7 @@ jobs:
135115
- name: Setup our testing directory, copy only the tests to it.
136116
run: |
137117
mkdir -p extra-tests/files
138-
cp arrow/r/extra-tests/helper*.R extra-tests/
139-
cp arrow/r/extra-tests/test-*.R extra-tests/
118+
cp arrow/r/extra-tests/*.R extra-tests/
140119
- name: Download artifacts
141120
uses: actions/download-artifact@v4
142121
with:

‎r/extra-tests/test-read-files.R‎

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,21 @@
1818
library(arrow)
1919
library(testthat)
2020

21-
source("tests/testthat/helper-skip.R")
21+
# These are similar to functions in tests/testthat/helper-skip.R but we duplicate them
22+
# here since very old versions don't have arrow_info() with exactly the same shape
23+
if_version <- function(version, op = `==`) {
24+
op(packageVersion("arrow"), version)
25+
}
26+
27+
if_version_less_than <- function(version) {
28+
if_version(version, op = `<`)
29+
}
30+
31+
skip_if_version_less_than <- function(version, msg) {
32+
if (if_version(version, `<`)) {
33+
skip(msg)
34+
}
35+
}
2236

2337
pq_file <- "files/ex_data.parquet"
2438

@@ -32,7 +46,7 @@ test_that("Can read the file (parquet)", {
3246

3347
### Parquet
3448
test_that("Can see the metadata (parquet)", {
35-
skip_if_arrow_version_less_than("2.0.0", "Version 1.0.1 can't read new version metadata.")
49+
skip_if_version_less_than("2.0.0", "Version 1.0.1 can't read new version metadata.")
3650

3751
df <- read_parquet(pq_file)
3852
expect_s3_class(df, "tbl")
@@ -76,7 +90,7 @@ for (comp in c("lz4", "uncompressed", "zstd")) {
7690
})
7791

7892
test_that(paste0("Can see the metadata (feather ", comp, ")"), {
79-
skip_if_arrow_version_less_than("2.0.0", "Version 1.0.1 can't read new version metadata.")
93+
skip_if_version_less_than("2.0.0", "Version 1.0.1 can't read new version metadata.")
8094

8195
df <- read_feather(feather_file)
8296
expect_s3_class(df, "tbl")
@@ -134,7 +148,7 @@ test_that("Can read the file (parquet)", {
134148
})
135149

136150
test_that("Can see the metadata (stream)", {
137-
skip_if_arrow_version_less_than("2.0.0", "Version 1.0.1 can't read new version metadata.")
151+
skip_if_version_less_than("2.0.0", "Version 1.0.1 can't read new version metadata.")
138152
df <- read_ipc_stream(stream_file)
139153

140154
expect_s3_class(df, "tbl")

‎r/tests/testthat/helper-skip.R‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -130,22 +130,6 @@ skip_on_python_older_than <- function(python_version) {
130130
}
131131
}
132132

133-
skip_if_arrow_version_less_than <- function(version, msg) {
134-
if (arrow_cpp_version() < numeric_version(version)) {
135-
skip(msg)
136-
}
137-
}
138-
139-
skip_if_arrow_version_equals <- function(version, msg) {
140-
if (arrow_cpp_version() == numeric_version(version)) {
141-
skip(msg)
142-
}
143-
}
144-
145-
arrow_cpp_version <- function() {
146-
numeric_version(gsub("-SNAPSHOT", "", arrow::arrow_info()$build_info["cpp_version"]))
147-
}
148-
149133
process_is_running <- function(x) {
150134
if (force_tests()) {
151135
# Return TRUE as this is used as a condition in an if statement

‎r/tests/testthat/test-compute-arith.R‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,6 @@ test_that("Math group generics work on Array objects", {
235235
})
236236

237237
test_that("hyperbolic trig functions work on Array objects", {
238-
skip_if_arrow_version_less_than("18.1.0.9000", "Hyperbolic trig functions not available until version 19.")
239-
240238
expect_equal(sinh(Array$create(c(0.6, 0.9))), Array$create(sinh(c(0.6, 0.9))))
241239
expect_equal(cosh(Array$create(c(0.6, 0.9))), Array$create(cosh(c(0.6, 0.9))))
242240
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", {
248246
})
249247

250248
test_that("expm1 works on Array objects", {
251-
skip_if_arrow_version_less_than("18.1.0.9000", "expm1 not available until version 19.")
252-
253249
expect_equal(expm1(Array$create(c(0.00000001, 10))), Array$create(expm1(c(0.00000001, 10))))
254250
})

‎r/tests/testthat/test-dplyr-funcs-math.R‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,6 @@ test_that("trig functions", {
339339
})
340340

341341
test_that("hyperbolic trig functions", {
342-
skip_if_arrow_version_less_than("18.1.0.9000", "Hyperbolic trig functions not available until version 19.")
343-
344342
# Note: We change df mid-test because domains differ by function
345343
df <- tibble(x = c(seq(from = 0, to = 1, by = 0.1), NA))
346344

@@ -495,8 +493,6 @@ test_that("sqrt()", {
495493
})
496494

497495
test_that("expm1()", {
498-
skip_if_arrow_version_less_than("18.1.0.9000", "`expm1()` not available until version 19.")
499-
500496
df <- tibble(x = c(1:5))
501497

502498
compare_dplyr_binding(

0 commit comments

Comments
 (0)