Skip to content

Commit

Permalink
ARROW-10834: [R] Fix print method for SubTreeFileSystem
Browse files Browse the repository at this point in the history
This PR modifies ``` `$.SubTreeFileSystem` ``` to return `NULL` if the named object is not found in the object. This allows the `print()` method of `ArrowObject` to print `SubTreeFileSystem` objects without error.

Closes apache#9168 from ianmcook/ARROW-10834

Authored-by: Ian Cook <[email protected]>
Signed-off-by: Neal Richardson <[email protected]>
  • Loading branch information
ianmcook authored and nealrichardson committed Jan 12, 2021
1 parent 3126553 commit af664c5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions r/R/filesystem.R
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,12 @@ SubTreeFileSystem$create <- function(base_path, base_fs = NULL) {
`$.SubTreeFileSystem` <- function(x, name, ...) {
# This is to allow delegating methods/properties to the base_fs
assert_that(is.string(name))
if (name %in% ls(x)) {
if (name %in% ls(envir = x)) {
get(name, x)
} else {
} else if (name %in% ls(envir = x$base_fs)) {
get(name, x$base_fs)
} else {
NULL
}
}

Expand Down

0 comments on commit af664c5

Please sign in to comment.