Skip to content

Commit b07e760

Browse files
authored
Advance 1.0.0 deprecations (#1194)
1 parent 29b36b1 commit b07e760

23 files changed

+505
-448
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# purrr (development version)
22

3+
* All functions that were soft-deprecated in purrr 1.0.0 are now fully deprecated. They will be removed in a future release. This includes: `invoke_*()`, `lift_*()`, `cross*()`, `prepend()`, `splice()`, `rbernoulli()`, `rdunif()`, `when()`, `update_list()`, `*_raw()`, `vec_depth()`.
4+
* `map_chr()` no longer coereces from logical, integer, or double to strings.
35
* All functions and arguments deprecated in purrr 0.3.0 have now been removed. This includes `%@%`, `accumulate_right()`, `at_depth()`, `cross_d()`, `cross_n()`, `reduce2_right()`, and `reduce_right()`.
46

57
# purrr 1.1.0

R/coerce.R

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,7 @@ coerce <- function(x, type) {
77
coerce_lgl <- function(x) coerce(x, "logical")
88
coerce_int <- function(x) coerce(x, "integer")
99
coerce_dbl <- function(x) coerce(x, "double")
10-
coerce_chr <- function(x) {
11-
local_deprecation_user_env()
12-
coerce(x, "character")
13-
}
14-
15-
16-
deprecate_to_char <- function(type) {
17-
lifecycle::deprecate_warn(
18-
"1.0.0",
19-
I(paste0("Automatic coercion from ", type, " to character")),
20-
I("an explicit call to `as.character()` within `map_chr()`"),
21-
always = TRUE,
22-
user_env = the$deprecation_user_env
23-
)
24-
}
25-
10+
coerce_chr <- function(x) coerce(x, "character")
2611

2712
# Can rewrite after https://github.com/r-lib/rlang/issues/1643
2813
local_deprecation_user_env <- function(

R/deprec-cross.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
#' list(x = x, y = x) |>
113113
#' cross(.filter = `==`)
114114
cross <- function(.l, .filter = NULL) {
115-
lifecycle::deprecate_soft(
115+
lifecycle::deprecate_warn(
116116
"1.0.0",
117117
"purrr::cross()",
118118
"tidyr::expand_grid()",
@@ -167,7 +167,7 @@ cross <- function(.l, .filter = NULL) {
167167
#' @export
168168
#' @rdname cross
169169
cross2 <- function(.x, .y, .filter = NULL) {
170-
lifecycle::deprecate_soft(
170+
lifecycle::deprecate_warn(
171171
"1.0.0",
172172
"purrr::cross2()",
173173
"tidyr::expand_grid()",
@@ -179,7 +179,7 @@ cross2 <- function(.x, .y, .filter = NULL) {
179179
#' @export
180180
#' @rdname cross
181181
cross3 <- function(.x, .y, .z, .filter = NULL) {
182-
lifecycle::deprecate_soft(
182+
lifecycle::deprecate_warn(
183183
"1.0.0",
184184
"purrr::cross3()",
185185
"tidyr::expand_grid()",
@@ -191,7 +191,7 @@ cross3 <- function(.x, .y, .z, .filter = NULL) {
191191
#' @rdname cross
192192
#' @export
193193
cross_df <- function(.l, .filter = NULL) {
194-
lifecycle::deprecate_soft(
194+
lifecycle::deprecate_warn(
195195
"1.0.0",
196196
"purrr::cross_df()",
197197
"tidyr::expand_grid()",

R/deprec-invoke.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
#'
8080
#' @export
8181
invoke <- function(.f, .x = NULL, ..., .env = NULL) {
82-
lifecycle::deprecate_soft("1.0.0", "invoke()", "exec()")
82+
lifecycle::deprecate_warn("1.0.0", "invoke()", "exec()")
8383

8484
.env <- .env %||% parent.frame()
8585
args <- c(as.list(.x), list(...))
@@ -97,7 +97,7 @@ as_invoke_function <- function(f) {
9797
#' @rdname invoke
9898
#' @export
9999
invoke_map <- function(.f, .x = list(NULL), ..., .env = NULL) {
100-
lifecycle::deprecate_soft("1.0.0", "invoke_map()", I("map() + exec()"))
100+
lifecycle::deprecate_warn("1.0.0", "invoke_map()", I("map() + exec()"))
101101

102102
.env <- .env %||% parent.frame()
103103
.f <- as_invoke_function(.f)
@@ -106,7 +106,7 @@ invoke_map <- function(.f, .x = list(NULL), ..., .env = NULL) {
106106
#' @rdname invoke
107107
#' @export
108108
invoke_map_lgl <- function(.f, .x = list(NULL), ..., .env = NULL) {
109-
lifecycle::deprecate_soft("1.0.0", "invoke_lgl()", I("map_lgl() + exec()"))
109+
lifecycle::deprecate_warn("1.0.0", "invoke_lgl()", I("map_lgl() + exec()"))
110110

111111
.env <- .env %||% parent.frame()
112112
.f <- as_invoke_function(.f)
@@ -115,7 +115,7 @@ invoke_map_lgl <- function(.f, .x = list(NULL), ..., .env = NULL) {
115115
#' @rdname invoke
116116
#' @export
117117
invoke_map_int <- function(.f, .x = list(NULL), ..., .env = NULL) {
118-
lifecycle::deprecate_soft("1.0.0", "invoke_int()", I("map_int() + exec()"))
118+
lifecycle::deprecate_warn("1.0.0", "invoke_int()", I("map_int() + exec()"))
119119

120120
.env <- .env %||% parent.frame()
121121
.f <- as_invoke_function(.f)
@@ -124,7 +124,7 @@ invoke_map_int <- function(.f, .x = list(NULL), ..., .env = NULL) {
124124
#' @rdname invoke
125125
#' @export
126126
invoke_map_dbl <- function(.f, .x = list(NULL), ..., .env = NULL) {
127-
lifecycle::deprecate_soft("1.0.0", "invoke_dbl()", I("map_dbl() + exec()"))
127+
lifecycle::deprecate_warn("1.0.0", "invoke_dbl()", I("map_dbl() + exec()"))
128128

129129
.env <- .env %||% parent.frame()
130130
.f <- as_invoke_function(.f)
@@ -133,7 +133,7 @@ invoke_map_dbl <- function(.f, .x = list(NULL), ..., .env = NULL) {
133133
#' @rdname invoke
134134
#' @export
135135
invoke_map_chr <- function(.f, .x = list(NULL), ..., .env = NULL) {
136-
lifecycle::deprecate_soft("1.0.0", "invoke_chr()", I("map_chr() + exec()"))
136+
lifecycle::deprecate_warn("1.0.0", "invoke_chr()", I("map_chr() + exec()"))
137137

138138
.env <- .env %||% parent.frame()
139139
.f <- as_invoke_function(.f)
@@ -142,7 +142,7 @@ invoke_map_chr <- function(.f, .x = list(NULL), ..., .env = NULL) {
142142
#' @rdname invoke
143143
#' @export
144144
invoke_map_raw <- function(.f, .x = list(NULL), ..., .env = NULL) {
145-
lifecycle::deprecate_soft("1.0.0", "invoke_raw()", I("map_raw() + exec()"))
145+
lifecycle::deprecate_warn("1.0.0", "invoke_raw()", I("map_raw() + exec()"))
146146

147147
.env <- .env %||% parent.frame()
148148
.f <- as_invoke_function(.f)
@@ -153,7 +153,7 @@ invoke_map_raw <- function(.f, .x = list(NULL), ..., .env = NULL) {
153153
#' @rdname invoke
154154
#' @export
155155
invoke_map_dfr <- function(.f, .x = list(NULL), ..., .env = NULL) {
156-
lifecycle::deprecate_soft(
156+
lifecycle::deprecate_warn(
157157
"1.0.0",
158158
"invoke_df()",
159159
I("map() + exec() + list_rbind()")

R/deprec-lift.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ NULL
6868
#' fun <- function(x) exec("sum", !!!x)
6969
#' exec(sum, 3, NA, 4, na.rm = TRUE)
7070
lift <- function(..f, ..., .unnamed = FALSE) {
71-
lifecycle::deprecate_soft("1.0.0", "lift()")
71+
lifecycle::deprecate_warn("1.0.0", "lift()")
7272

7373
force(..f)
7474
defaults <- list(...)
@@ -87,7 +87,7 @@ lift_dl <- lift
8787
#' @rdname lift
8888
#' @export
8989
lift_dv <- function(..f, ..., .unnamed = FALSE) {
90-
lifecycle::deprecate_soft("1.0.0", "lift_dv()")
90+
lifecycle::deprecate_warn("1.0.0", "lift_dv()")
9191

9292
force(..f)
9393
defaults <- list(...)
@@ -121,7 +121,7 @@ lift_dv <- function(..f, ..., .unnamed = FALSE) {
121121
#' # now
122122
#' pmap_dbl(mtcars, \(...) mean(c(...)))
123123
lift_vl <- function(..f, ..., .type) {
124-
lifecycle::deprecate_soft("1.0.0", "lift_vl()")
124+
lifecycle::deprecate_warn("1.0.0", "lift_vl()")
125125

126126
force(..f)
127127
defaults <- list(...)
@@ -138,7 +138,7 @@ lift_vl <- function(..f, ..., .type) {
138138
#' @rdname lift
139139
#' @export
140140
lift_vd <- function(..f, ..., .type) {
141-
lifecycle::deprecate_soft("1.0.0", "lift_vd()")
141+
lifecycle::deprecate_warn("1.0.0", "lift_vd()")
142142

143143
force(..f)
144144
defaults <- list(...)
@@ -177,7 +177,7 @@ lift_vd <- function(..f, ..., .type) {
177177
#' mtcars |> pmap_lgl(\(...) any(c(...) > 200))
178178
#'
179179
lift_ld <- function(..f, ...) {
180-
lifecycle::deprecate_soft("1.0.0", "lift_ld()")
180+
lifecycle::deprecate_warn("1.0.0", "lift_ld()")
181181

182182
force(..f)
183183
defaults <- list(...)
@@ -189,7 +189,7 @@ lift_ld <- function(..f, ...) {
189189
#' @rdname lift
190190
#' @export
191191
lift_lv <- function(..f, ...) {
192-
lifecycle::deprecate_soft("1.0.0", "lift_lv()")
192+
lifecycle::deprecate_warn("1.0.0", "lift_lv()")
193193

194194
force(..f)
195195
defaults <- list(...)

R/deprec-prepend.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#' x |> prepend(list("a", "b"), before = 3)
2727
#' prepend(list(), x)
2828
prepend <- function(x, values, before = NULL) {
29-
lifecycle::deprecate_soft("1.0.0", "prepend()", I("append(after = 0)"))
29+
lifecycle::deprecate_warn("1.0.0", "prepend()", I("append(after = 0)"))
3030

3131
n <- length(x)
3232
stopifnot(is.null(before) || (before > 0 && before <= n))

R/deprec-rerun.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ deprec_rerun <- function(.n, ..., .purrr_user_env) {
6464
new <- substitute(map(1:n, ~ list(...)))
6565
}
6666

67-
lifecycle::deprecate_soft(
67+
lifecycle::deprecate_warn(
6868
when = "1.0.0",
6969
what = "rerun()",
7070
with = "map()",

R/deprec-splice.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#' c(inputs, arg3 = c("c1", "c2")) |> str()
2323
#' @export
2424
splice <- function(...) {
25-
lifecycle::deprecate_soft("1.0.0", "splice()", "list_flatten()")
25+
lifecycle::deprecate_warn("1.0.0", "splice()", "list_flatten()")
2626

2727
splice_if(list(...), is_bare_list)
2828
}

R/deprec-utils.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#' rbernoulli(10)
1616
#' rbernoulli(100, 0.1)
1717
rbernoulli <- function(n, p = 0.5) {
18-
lifecycle::deprecate_soft("1.0.0", "rbernoulli()")
18+
lifecycle::deprecate_warn("1.0.0", "rbernoulli()")
1919
stats::runif(n) > (1 - p)
2020
}
2121

@@ -35,7 +35,7 @@ rbernoulli <- function(n, p = 0.5) {
3535
#' table(rdunif(1e3, 10))
3636
#' table(rdunif(1e3, 10, -5))
3737
rdunif <- function(n, b, a = 1) {
38-
lifecycle::deprecate_soft("1.0.0", "rdunif()")
38+
lifecycle::deprecate_warn("1.0.0", "rdunif()")
3939

4040
stopifnot(is.numeric(a), length(a) == 1)
4141
stopifnot(is.numeric(b), length(b) == 1)

R/deprec-when.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
#' }
5555
#' @export
5656
when <- function(., ...) {
57-
lifecycle::deprecate_soft("1.0.0", "when()", I("`if`"))
57+
lifecycle::deprecate_warn("1.0.0", "when()", I("`if`"))
5858

5959
dots <- list(...)
6060
names <- names(dots)

0 commit comments

Comments
 (0)