jonkeane commented on a change in pull request #12277:
URL: https://github.com/apache/arrow/pull/12277#discussion_r794637336



##########
File path: r/R/dataset-format.R
##########
@@ -133,10 +133,36 @@ CsvFileFormat$create <- function(...,
   schema_names <- names(schema)
 
   if (!is.null(schema) & !identical(schema_names, column_names)) {
+    missing_from_schema <- setdiff(column_names, schema_names)
+    missing_from_colnames <- setdiff(schema_names, column_names)
+    message_colnames <- NULL
+    message_schema <- NULL
+    message_order <- NULL
+
+    if (length(missing_from_colnames) > 0) {
+      message_colnames <- paste(
+        oxford_paste(missing_from_colnames, quote_symbol = "`"),
+        "not present in `column_names`"
+      )
+    }
+
+    if (length(missing_from_schema) > 0) {
+      message_schema <- paste(
+        oxford_paste(missing_from_schema, quote_symbol = "`"),
+        "not present in schema"

Review comment:
       Minor: should `schema` here also be in backticks? `column_names` is up 
above, though on the other hand, I think it's a little bit weird we treat 
column names and arguments the same(?) Do we already (or does the tidyverse 
style guide) have a clear decision on how to quote column names, arguments, 
etc.?




-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to