You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/01/11 21:47:37 UTC

[GitHub] [arrow] ianmcook commented on a change in pull request #9168: ARROW-10834: [R] Fix print method for SubTreeFileSystem

ianmcook commented on a change in pull request #9168:
URL: https://github.com/apache/arrow/pull/9168#discussion_r555361025



##########
File path: r/R/filesystem.R
##########
@@ -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

Review comment:
       Using `envir` in these `ls()` calls stops this cryptic warning from being issued when the external pointer breaks:
   ```
   In addition: Warning message:
   In ls(x$base_fs) : ‘x$base_fs’ converted to character string
   ```
   That warning comes from a part of the code in `ls()` that doesn't run if you pass the object as `envir`.




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