-
Notifications
You must be signed in to change notification settings - Fork 4.3k
GH-51655: [R] Advance long-standing deprecations in map_batches() and pull() #51658
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,7 +56,7 @@ compute.arrow_dplyr_query <- function(x, ...) { | |
| } | ||
| compute.Dataset <- compute.RecordBatchReader <- compute.arrow_dplyr_query | ||
|
|
||
| pull.Dataset <- function(.data, var = -1, ..., as_vector = getOption("arrow.pull_as_vector")) { | ||
| pull.Dataset <- function(.data, var = -1, ..., as_vector = getOption("arrow.pull_as_vector", TRUE)) { | ||
| .data <- as_adq(.data) | ||
| var <- vars_pull(names(.data), !!enquo(var)) | ||
| .data$selected_columns <- set_names(.data$selected_columns[var], var) | ||
|
|
@@ -65,32 +65,12 @@ pull.Dataset <- function(.data, var = -1, ..., as_vector = getOption("arrow.pull | |
| } | ||
| pull.RecordBatchReader <- pull.arrow_dplyr_query <- pull.Dataset | ||
|
|
||
| pull.ArrowTabular <- function(x, var = -1, ..., as_vector = getOption("arrow.pull_as_vector")) { | ||
| pull.ArrowTabular <- function(x, var = -1, ..., as_vector = getOption("arrow.pull_as_vector", TRUE)) { | ||
| out <- x[[vars_pull(names(x), !!enquo(var))]] | ||
| handle_pull_as_vector(out, as_vector) | ||
| } | ||
|
|
||
| handle_pull_as_vector <- function(out, as_vector) { | ||
| if (is.null(as_vector)) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did some digging (well tasked a clanker to do the digging...) to see why we did this in the first place. Here it is for posterity (or some future clanker to dig it up). We originally proposed to do this since there wasn't another ergonomic way to get a chunked array, and unlike It turns out that broke dependencies so we made it opt in at the time, though there has been consistent feedback that other engines like I'm good with undeprecating this. Though I am slightly curious (and we should do this in a follow on if we do), do we now have a (more) ergonomic way to get a chunked array? is it |
||
| 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) | ||
| } | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.