Copilot commented on code in PR #49276:
URL: https://github.com/apache/arrow/pull/49276#discussion_r3551899817
##########
r/R/ipc-stream.R:
##########
@@ -89,18 +98,27 @@ 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()`.
+#' @param ... deprecated and ignored.
#'
#' @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, ...) {
+ if (length(list(...)) > 0) {
+ .Deprecated(
+ msg = paste(
+ "Extra arguments passed through `...` in `read_ipc_stream()`",
+ "are deprecated and ignored.",
+ "They will be removed in a future version."
+ )
+ )
+ }
Review Comment:
`length(list(...))` forces evaluation of `...`, which changes behavior for
callers who pass expensive expressions or expressions with side effects
(previously unused `...` would not be evaluated). To detect whether `...` was
supplied without evaluating it, inspect `match.call(expand.dots = FALSE)$...`
instead.
##########
r/R/ipc-stream.R:
##########
@@ -36,6 +36,15 @@
#' on.exit(unlink(tf))
#' write_ipc_stream(mtcars, tf)
write_ipc_stream <- function(x, sink, ...) {
+ if (length(list(...)) > 0) {
+ .Deprecated(
+ msg = paste(
+ "Extra arguments passed through `...` in `write_ipc_stream()`",
+ "are deprecated and ignored.",
+ "They will be removed in a future version."
+ )
+ )
+ }
Review Comment:
`length(list(...))` forces evaluation of `...`, which changes behavior for
callers who pass expensive expressions or expressions with side effects
(previously unused `...` would not be evaluated). To detect whether `...` was
supplied without evaluating it, inspect `match.call(expand.dots = FALSE)$...`
instead.
--
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]