thisisnic commented on a change in pull request #12083:
URL: https://github.com/apache/arrow/pull/12083#discussion_r785542810
##########
File path: r/R/dataset-format.R
##########
@@ -122,6 +122,18 @@ CsvFileFormat$create <- function(...,
opts = csv_file_format_parse_options(...),
convert_options =
csv_file_format_convert_opts(...),
read_options =
csv_file_format_read_opts(...)) {
+
+ options <- list(...)
+ schema <- options[["schema"]]
+
+ if (length(read_options$column_names) > 0 & !is.null(schema) &
!identical(names(schema), read_options$column_names)) {
+ abort(c(
+ '"column_names" in read_options do not match the schema.',
+ i = "Set column_names in read_options to match the schema",
+ i = "Omit the read_options argument"
+ ))
Review comment:
Also, please could you add a test which triggers this error?
--
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]