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



##########
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:
       Sure, though would we want to also expand it to check if `length(.list) 
== 1` && `all(map_lgl(.list, ~ inherits(.x, "DataType")))` and allow that too?




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