paleolimbot commented on a change in pull request #11668:
URL: https://github.com/apache/arrow/pull/11668#discussion_r747439162
##########
File path: r/R/csv.R
##########
@@ -623,8 +632,38 @@ readr_to_csv_convert_options <- function(na,
#' @include arrow-package.R
write_csv_arrow <- function(x,
sink,
+ na = NULL,
+ append = NULL,
+ quote = NULL,
+ escape = NULL,
+ eol = NULL,
+ num_threads = NULL,
+ progress = NULL,
include_header = TRUE,
batch_size = 1024L) {
+
+ passed_args <- as.list(match.call()[-1])
+
+ arrow_write_opts <- names(formals(CsvWriteOptions$create))
+ write_args <- names(formals(write_csv_arrow))
+
+ unsupported_opts <- setdiff(
+ write_args,
+ union(arrow_write_opts, c("x", "sink"))
+ )
+
+ unsupported_passed_args <- names(unlist(passed_args[unsupported_opts]))
+
+ if (length(unsupported_passed_args)) {
+ stop(
+ "The following ",
+ ngettext(length(unsupported_passed_args), "argument is ", "arguments are
"),
+ "not yet supported in Arrow: ",
+ oxford_paste(unsupported_passed_args),
+ call. = FALSE
+ )
+ }
Review comment:
I think you might be better off with something like:
``` r
write_csv_arrow <- function(x, file, the = "options", you = "do", support =
"right now", ..., sink = "DEPRECTED") {
unsupported_passed_args <- names(list(...))
# handle difference in name between 'file' and 'sink'
# convert write_csv() names/values to the names/values you need for
`CsvWriteOptions$create()`
# ...
}
```
(a little simpler and doesn't assume that the names of
`CsvWriteOptions::create()` are going to be the names that readr chose for
write_csv`)
--
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]