Skip to content

[R] Advance long-standing deprecations in map_batches() and pull() #51655

Description

@thisisnic

Describe the enhancement requested

Two deprecations in the R package have been in place for a long time and can be advanced for 26.0.0.

  1. The .data.frame argument to map_batches() has warned and been ignored since 9.0.0 (ARROW-15271). It can be removed.

arrow/r/R/dataset-scan.R

Lines 225 to 232 in 9479e68

#' @export
map_batches <- function(X, FUN, ..., .schema = NULL, .lazy = TRUE, .data.frame = NULL) {
if (!is.null(.data.frame)) {
warning(
"The .data.frame argument is deprecated. ",
"Call collect() on the result to get a data.frame.",
call. = FALSE
)

  1. pull() on Arrow data has warned since 11.0.0 (ARROW-18132) that returning an R vector by default is deprecated and a future release will return a ChunkedArray. The default of as_vector can now switch to FALSE, and the docs in dplyr-funcs-doc.R updated to match.

handle_pull_as_vector <- function(out, as_vector) {
if (is.null(as_vector)) {
warn(
c(
paste(
"Default behavior of `pull()` on Arrow data is changing. Current",
"behavior of returning an R vector is deprecated, and in a future",
"release, it will return an Arrow `ChunkedArray`. To control this:"
),
i = paste(
"Specify `as_vector = TRUE` (the current default) or",
"`FALSE` (what it will change to) in `pull()`"
),
i = "Or, set `options(arrow.pull_as_vector)` globally"
),
.frequency = "regularly",
.frequency_id = "arrow.pull_as_vector",
class = "lifecycle_warning_deprecated"
)
as_vector <- TRUE
}
if (as_vector) {
out <- as.vector(out)

Component(s)

R

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions