ianmcook commented on a change in pull request #11668:
URL: https://github.com/apache/arrow/pull/11668#discussion_r758548718
##########
File path: r/R/csv.R
##########
@@ -623,9 +638,58 @@ readr_to_csv_convert_options <- function(na,
#' @include arrow-package.R
write_csv_arrow <- function(x,
sink,
+ file = NULL,
include_header = TRUE,
- batch_size = 1024L) {
- write_options <- CsvWriteOptions$create(include_header, batch_size)
+ col_names = NULL,
+ batch_size = 1024L,
+ write_options = NULL,
+ ...) {
+ unsupported_passed_args <- names(list(...))
+
+ 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
+ )
+ }
+
+ if (!missing(file) && !missing(sink)) {
+ stop(
+ paste("You have supplied both \"file\" and \"sink\" arguments. Please",
+ "supply only one of them."),
+ call. = FALSE
+ )
Review comment:
Can simplify this by removing the `paste()` since `stop()` already
pastes together its arguments (with no separator)
```suggestion
stop(
"You have supplied both \"file\" and \"sink\" arguments. ",
"Please supply only one of them.",
call. = FALSE
)
```
--
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]