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



##########
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:
       I see what you're going for here, and this is super helpful for our 
specific case! But I think it would be better to check that `schema` does 
`inherit()` from `"Schema"` and provide a helpful error message if it doesn't.
   
   That way we also catch cases where  `schema` is passed some other object 
type and it's clear that the input was an error / there is a difference between 
the schema and partitioning




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