thisisnic commented on code in PR #33614:
URL: https://github.com/apache/arrow/pull/33614#discussion_r1068471475
##########
r/R/dataset-format.R:
##########
@@ -118,102 +118,71 @@ IpcFileFormat <- R6Class("IpcFileFormat", inherit =
FileFormat)
#' @rdname FileFormat
#' @export
CsvFileFormat <- R6Class("CsvFileFormat", inherit = FileFormat)
-CsvFileFormat$create <- function(...,
- opts = csv_file_format_parse_options(...),
- convert_options =
csv_file_format_convert_opts(...),
- read_options =
csv_file_format_read_opts(...)) {
- check_csv_file_format_args(...)
- # Evaluate opts first to catch any unsupported arguments
- force(opts)
-
- options <- list(...)
- schema <- options[["schema"]]
- if (!is.null(schema) && !inherits(schema, "Schema")) {
- abort(paste0(
- "`schema` must be an object of class 'Schema' not '",
- class(schema)[1],
- "'."
- ))
- }
+CsvFileFormat$create <- function(...) {
Review Comment:
Good points made; the refactoring I did here is because that bit of the code
was overly complex, so in the name of usability, I think it'll make more sense
to write actual independent docs for this function with more explicit
information about its usage.
--
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]