thisisnic commented on a change in pull request #11645:
URL: https://github.com/apache/arrow/pull/11645#discussion_r745797915



##########
File path: r/R/schema.R
##########
@@ -157,6 +165,9 @@ Schema$create <- function(...) {
   .list <- list2(...)
   if (all(map_lgl(.list, ~ inherits(., "Field")))) {
     schema_(.list)
+  } else if (is.null(names(.list))) {
+    # If not supplied as fields, only other alternative is e.g.`a = int16()`
+    abort("Schema definitions must be supplied as field/data type or field 
name/data type pairs")
   } else {
     schema_(.fields(.list))
   }

Review comment:
       (i.e. so the user can supply a list of name/value pairs and it's not 
important which of the 2 methods they use - fields or just field names)




-- 
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