Copilot commented on code in PR #49276: URL: https://github.com/apache/arrow/pull/49276#discussion_r3316932578
########## r/R/ipc-stream.R: ########## @@ -20,22 +20,21 @@ #' Apache Arrow defines two formats for [serializing data for interprocess #' communication #' (IPC)](https://arrow.apache.org/docs/format/Columnar.html#serialization-and-interprocess-communication-ipc): -#' a "stream" format and a "file" format, known as Feather. `write_ipc_stream()` -#' and [write_feather()] write those formats, respectively. +#' a "stream" format and a "file" format. `write_ipc_stream()` +#' and [write_ipc_file()] write those formats, respectively. #' -#' @inheritParams write_feather -#' @param ... extra parameters passed to `write_feather()`. +#' @inheritParams write_ipc_file #' #' @return `x`, invisibly. -#' @seealso [write_feather()] for writing IPC files. [write_to_raw()] to +#' @seealso [write_ipc_file()] for writing IPC files. [write_to_raw()] to #' serialize data to a buffer. #' [RecordBatchWriter] for a lower-level interface. #' @export #' @examples #' tf <- tempfile() #' on.exit(unlink(tf)) #' write_ipc_stream(mtcars, tf) -write_ipc_stream <- function(x, sink, ...) { +write_ipc_stream <- function(x, sink) { Review Comment: Removing `...` from this exported function is a breaking API change for callers that currently pass additional arguments (the previous signature accepted them, even if ignored). Since this PR is only deprecating Feather APIs, keep `...` in the signature for compatibility or add an explicit deprecation path before removing it. ########## r/R/ipc-stream.R: ########## @@ -89,18 +88,17 @@ write_to_raw <- function(x, format = c("stream", "file")) { #' open. #' @param as_data_frame Should the function return a `tibble` (default) or #' an Arrow [Table]? -#' @param ... extra parameters passed to `read_feather()`. #' #' @return A `tibble` if `as_data_frame` is `TRUE` (the default), or an #' Arrow [Table] otherwise -#' @seealso [write_feather()] for writing IPC files. [RecordBatchReader] for a +#' @seealso [write_ipc_file()] for writing IPC files. [RecordBatchReader] for a #' lower-level interface. #' @section Untrusted data: #' If reading from an untrusted source, you can validate the data by reading #' with `as_data_frame = FALSE` and calling `$ValidateFull()` on the Table #' before processing. #' @export -read_ipc_stream <- function(file, as_data_frame = TRUE, ...) { +read_ipc_stream <- function(file, as_data_frame = TRUE) { Review Comment: Removing `...` from this exported reader changes the public API for `read_ipc_stream()` and will turn previously accepted extra arguments into unused-argument errors. Keep `...` for backward compatibility (even if ignored) or deprecate those extra arguments separately before removing them. ########## r/R/feather.R: ########## @@ -15,56 +15,25 @@ # specific language governing permissions and limitations # under the License. -#' Write a Feather file (an Arrow IPC file) +#' Write a Feather file (deprecated) #' -#' Feather provides binary columnar serialization for data frames. -#' It is designed to make reading and writing data frames efficient, -#' and to make sharing data across data analysis languages easy. -#' [write_feather()] can write both the Feather Version 1 (V1), -#' a legacy version available starting in 2016, and the Version 2 (V2), -#' which is the Apache Arrow IPC file format. -#' The default version is V2. -#' V1 files are distinct from Arrow IPC files and lack many features, -#' such as the ability to store all Arrow data tyeps, and compression support. -#' [write_ipc_file()] can only write V2 files. +#' @description +#' `write_feather()` is deprecated and will be removed in a future release. +#' Use [write_ipc_file()] instead. #' -#' @param x `data.frame`, [RecordBatch], or [Table] -#' @param sink A string file path, connection, URI, or [OutputStream], or path in a file -#' system (`SubTreeFileSystem`) +#' Column-oriented file format designed for fast reading and writing +#' of data frames. Feather V2 is the Arrow IPC file format. +#' Feather V1 is a legacy format available starting in 2016 that lacks many +#' features, such as the ability to store all Arrow data types, and compression +#' support. Feather V1 is deprecated; use [write_ipc_file()] for new files. +#' +#' @inheritParams write_ipc_file #' @param version integer Feather file version, Version 1 or Version 2. Version 2 is the default. Review Comment: The inherited `write_ipc_file()` parameter docs no longer mention the `write_feather(version = 1)` restrictions, but this function still accepts `version = 1` and errors when `chunk_size`, `compression`, or `compression_level` are supplied. Please keep V1-specific parameter notes here so the documented arguments match the behavior. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
