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



##########
File path: r/R/dataset.R
##########
@@ -64,6 +64,12 @@ open_dataset <- function(sources,
                          partitioning = hive_partition(),
                          unify_schemas = NULL,
                          ...) {
+  # If you aren't explicit with the argument names it looks like everything
+  # works but it will create a segfault and crash the R session, this fixes it
+  if (any(class(schema) %in% "HivePartitioning")) {
+    partitioning <- schema
+    schema <- NULL
+  }

Review comment:
       Excellent! A small change to the text of the message: I don't think we 
need to mention partitions at all (if the person was confused like I was when I 
ran into this I already thought I was passing this to the partition argument so 
as soon as it said schema I would have looked at the docs and 🤦 ed. 
   
   How about: 
   
   ```
   stop("'schema' must be a Schema object", call. = FALSE)
   ```
   
    this [matches some of the other error messages in the 
package](https://github.com/apache/arrow/blob/master/r/R/array.R#L207)




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to