nealrichardson commented on a change in pull request #8058:
URL: https://github.com/apache/arrow/pull/8058#discussion_r486656550
##########
File path: r/R/filesystem.R
##########
@@ -242,11 +242,31 @@ FileSystem <- R6Class("FileSystem", inherit = ArrowObject,
)
)
FileSystem$from_uri <- function(uri) {
+ assert_that(is.string(uri))
out <- fs___FileSystemFromUri(uri)
out$fs <- shared_ptr(FileSystem, out$fs)$..dispatch()
out
}
+get_path_and_filesystem <- function(x, filesystem = NULL) {
+ # Wrapper around FileSystem$from_uri that handles local paths
+ # and an optional explicit filesystem
+ assert_that(is.string(x))
+ if (is_url(x)) {
+ if (!is.null(filesystem)) {
+ # Stop? Can't have URL (which yields a fs) and another fs
Review comment:
What happens here is that `filesystem` will be ignored if `x` is a URL,
i.e. we'll use the filesystem that `from_uri(x)` returns. So that should either
Just Work if the filesystems happen to be the same, or you're right, it should
error with some kind of File Not Found later.
----------------------------------------------------------------
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]