Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump minimum R version to 3.6.0 and make related tweaks #7026

Merged
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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ License: MIT + file LICENSE
URL: https://dplyr.tidyverse.org, https://github.com/tidyverse/dplyr
BugReports: https://github.com/tidyverse/dplyr/issues
Depends:
R (>= 3.5.0)
R (>= 3.6.0)
Imports:
cli (>= 3.6.2),
generics,
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# dplyr (development version)

* R >=3.6.0 is now explicitly required (#7026).

# dplyr 1.1.4

* `join_by()` now allows its helper functions to be namespaced with `dplyr::`,
Expand Down
12 changes: 2 additions & 10 deletions R/mutate.R
Original file line number Diff line number Diff line change
Expand Up @@ -501,13 +501,9 @@

# Cancel early exits, e.g. from an exiting handler. This way we can
# still instrument caught warnings to avoid confusing
# inconsistencies. This doesn't work on versions of R older than
# 3.5.0 because they don't include this change:
# https://github.com/wch/r-source/commit/688eaebf. So with
# `tryCatch(warning = )`, the original warning `cnd` will be caught
# instead of the instrumented warning.
# inconsistencies.
on.exit(
if (can_return_from_exit && early_exit) {
if (early_exit) {

Check warning on line 506 in R/mutate.R

View check run for this annotation

Codecov / codecov/patch

R/mutate.R#L506

Added line #L506 was not covered by tests
return(FALSE)
}
)
Expand All @@ -523,7 +519,3 @@
early_exit <- FALSE
muffled
}

on_load(
can_return_from_exit <- getRversion() >= "3.5.0"
)
18 changes: 2 additions & 16 deletions R/slice.R
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,13 @@ slice_eval <- function(mask,
user_env = caller_env(2)) {
index <- 0L
impl <- function(...) {
n <- ...length2()
n <- ...length()
out <- vector("list", n)

for (i in seq_len(n)) {
index <<- i

slice_idx <- ...elt2(i)
slice_idx <- ...elt(i)

if (is.matrix(slice_idx) && ncol(slice_idx) == 1) {
lifecycle::deprecate_warn(
Expand Down Expand Up @@ -588,17 +588,3 @@ on_load({
dplyr_local_slice_by_arg <- function(by_arg, frame = caller_env()) {
local_bindings(slice_by_arg = by_arg, .env = the, .frame = frame)
}

# Backports for R 3.5.0 utils
...length2 <- function(frame = caller_env()) {
dots <- env_get(frame, "...")

if (is_missing(dots)) {
0L
} else {
length(dots)
}
}
...elt2 <- function(i, frame = caller_env()) {
eval_bare(sym(paste0("..", i)), frame)
}
2 changes: 0 additions & 2 deletions tests/testthat/helper-lazy.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
skip_if_no_lazy_character <- function() {
skip_if(getRversion() <= "3.5.0")

new_lazy_character <- import_vctrs("new_lazy_character", optional = TRUE)
lazy_character_is_materialized <- import_vctrs("lazy_character_is_materialized", optional = TRUE)

Expand Down
Loading