Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/r.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
strategy:
fail-fast: false
matrix:
r: ["4.4"]
r: ["4.5"]
ubuntu: [24.04]
force-tests: ["true"]
env:
Expand Down
33 changes: 10 additions & 23 deletions .github/workflows/r_extra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,34 +129,21 @@ jobs:
image: r
runs-on: ubuntu-latest
title: Rhub
# Disabled: rhub/ubuntu-gcc12 image uses GCC 12 but CRAN now uses GCC 15.
# See https://github.com/apache/arrow/issues/49737
# Re-enable once r-hub/containers provides a GCC 15 image (#49738).
# - envs:
# - R_CUSTOM_CCACHE=true
# - R_IMAGE=ubuntu-gcc12
# - R_ORG=rhub
# image: r
# runs-on: ubuntu-latest
# title: Rhub GCC 12
# Disabled: rhub/gcc13 image uses GCC 13 but CRAN now uses GCC 15.
# See https://github.com/apache/arrow/issues/49737
# Re-enable once r-hub/containers provides a GCC 15 image (#49738).
# - envs:
# - R_IMAGE=gcc13
# - R_ORG=rhub
# image: r
# runs-on: ubuntu-latest
# run-options: >-
# -e INSTALL_ARGS=--use-LTO
# title: Rhub GCC 13 with LTO
- envs:
- R_IMAGE=ubuntu-gcc15
- R_ORG=rhub
image: r
runs-on: ubuntu-latest
run-options: >-
-e INSTALL_ARGS=--use-LTO
title: Rhub GCC 15 with LTO
- envs:
- R_IMAGE=r-base
- R_ORG=rstudio
- R_TAG=4.2-jammy
- R_TAG=4.4-jammy
image: r
runs-on: ubuntu-latest
title: RStudio R-Base 4.2
title: RStudio R-Base 4.4
env:
ARCHERY_DEBUG: 1
ARROW_ENABLE_TIMING_TESTS: OFF
Expand Down
1 change: 1 addition & 0 deletions dev/tasks/r/github.linux.versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
- "4.1"
- "4.2"
- "4.3"
- "4.4"
env:
R_ORG: "rstudio"
R_IMAGE: "r-base"
Expand Down
28 changes: 17 additions & 11 deletions r/tests/testthat/helper-arrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,25 @@ options(arrow.pull_as_vector = FALSE)

with_language <- function(lang, expr) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, why do we have our own with_language() here? I might try out the withr one before we merge this...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does #37811 (comment) have any info about why we have a separate one?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, sort of makes sense.

skip_on_cran()
old <- Sys.getenv("LANGUAGE")
# Check what this message is before changing languages; this will
# trigger caching the translations if the OS does that (some do).
# If the OS does cache, then we can't test changing languages safely.
before <- i18ize_error_messages()
Sys.setenv(LANGUAGE = lang)
on.exit({
Sys.setenv(LANGUAGE = old)
# We know we're LANGUAGE=en because we just set it above.
# We only need to check whether we can change languages if we're not "en".
if (!identical(lang, "en")) {
.cache$i18ized_error_pattern <<- NULL
})
if (!identical(before, i18ize_error_messages())) {
skip(paste("This OS either does not support changing languages to", lang, "or it caches translations"))
old <- Sys.getenv("LANGUAGE")
# Check what this message is before changing languages; this will
# trigger caching the translations if the OS does that (some do).
# If the OS does cache, then we can't test changing languages safely.
before <- i18ize_error_messages()
Sys.setenv(LANGUAGE = lang)
on.exit({
Sys.setenv(LANGUAGE = old)
.cache$i18ized_error_pattern <<- NULL
})
if (identical(before, i18ize_error_messages())) {
skip(paste("This OS either does not support changing languages to", lang, "or it caches translations"))
}
}

force(expr)
}

Expand Down
27 changes: 14 additions & 13 deletions r/tests/testthat/test-dplyr-filter.R
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,21 @@ test_that("filter environment scope", {
})

test_that("Filtering on a column that doesn't exist errors correctly", {
# expect_warning(., NA) because the usual behavior when it hits a filter
# that it can't evaluate is to raise a warning, collect() to R, and retry
# the filter. But we want this to error the first time because it's
# a user error, not solvable by retrying in R
expect_warning(
expect_error(
tbl |> record_batch() |> filter(not_a_col == 42) |> collect(),
"object 'not_a_col' not found"
),
NA
)
})
Comment thread
thisisnic marked this conversation as resolved.

test_that("Filtering on a non-existent column errors in the correct language", {
with_language("fr", {
# expect_warning(., NA) because the usual behavior when it hits a filter
# that it can't evaluate is to raise a warning, collect() to R, and retry
# the filter. But we want this to error the first time because it's
# a user error, not solvable by retrying in R
expect_warning(
expect_error(
tbl |> record_batch() |> filter(not_a_col == 42) |> collect(),
Expand All @@ -300,15 +310,6 @@ test_that("Filtering on a column that doesn't exist errors correctly", {
NA
)
})
with_language("en", {
expect_warning(
expect_error(
tbl |> record_batch() |> filter(not_a_col == 42) |> collect(),
"object 'not_a_col' not found"
),
NA
)
})
})

test_that("Filtering with unsupported functions", {
Expand Down
Loading