wjones127 commented on code in PR #13577:
URL: https://github.com/apache/arrow/pull/13577#discussion_r920311560
##########
r/R/io.R:
##########
@@ -241,7 +241,9 @@ mmap_open <- function(path, mode = c("read", "write",
"readwrite")) {
make_readable_file <- function(file, mmap = TRUE, compression = NULL,
filesystem = NULL) {
if (inherits(file, "SubTreeFileSystem")) {
filesystem <- file$base_fs
- file <- file$base_path
+ # SubTreeFileSystem adds a slash to base_path, but filesystems will reject
file names
+ # with trailing slashes, so we need to remove it here.
+ file <- sub("/$", "", file$base_path)
Review Comment:
Oh I see. Yeah I just blindly updated this without thinking about what
happens downstream 🤦
Below it will go through the code path where `is.string(file)` and
`!is.null(filesystem)` are both `TRUE`, so it will later call `file <-
filesystem$OpenInputFile(file)`. So it went from `SubTreeFilesystem` to a
`CharacterVector` to a `<whatever OpenInputFile returns>`. Wow that is some
very dynamic typing 😵
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]