nealrichardson commented on a change in pull request #9800:
URL: https://github.com/apache/arrow/pull/9800#discussion_r607440148



##########
File path: r/R/filesystem.R
##########
@@ -273,33 +273,53 @@ FileSystem$from_uri <- function(uri) {
   fs___FileSystemFromUri(uri)
 }
 
-get_path_and_filesystem <- function(x, filesystem = NULL) {
+get_paths_and_filesystem <- function(x, filesystem = NULL) {
   # Wrapper around FileSystem$from_uri that handles local paths
   # and an optional explicit filesystem
   if (inherits(x, "SubTreeFileSystem")) {
     return(list(fs = x$base_fs, path = x$base_path))
   }
-  assert_that(is.string(x))
-  if (is_url(x)) {
+  assert_that(is.character(x))
+  are_urls <- are_urls(x)
+  if (any(are_urls)) {
+    if (!all(are_urls)) {
+      stop("Vectors of mixed paths and URIs are not supported", call. = FALSE)

Review comment:
       My point was just that this utility knows nothing about datasets or any 
of that, it just takes a reference to a file (or in this case now, a vector of 
them), which may be a string path (with an optional `filesystem` specified), a 
URI, or a SubTreeFileSystem (a hacky way to specify a fs+path together), and 
returns a standard (fs, path) tuple. It seems like the responsibility of 
FileSystemDatasetFactory or whatever to validate that the resulting fs+paths 
are conforming to its requirements. 




-- 
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:
us...@infra.apache.org


Reply via email to