edponce commented on a change in pull request #11447:
URL: https://github.com/apache/arrow/pull/11447#discussion_r731546683



##########
File path: python/pyarrow/_fs.pyx
##########
@@ -833,6 +833,12 @@ cdef class SubTreeFileSystem(FileSystem):
         FileSystem.init(self, wrapped)
         self.subtreefs = <CSubTreeFileSystem*> wrapped.get()
 
+    def __str__(self):
+        return f'SubTreeFileSystem: file:{self.base_path}'

Review comment:
       Well, I think a better route would be for `SubTreeFileSystem` to print 
the `base_path` combined with output of the `__str__/__repr__` methods of 
`FileSystem` class. But it seems that `FileSystem` doesn't have 
`__str__/__repr__`...yet.
   
   Similar to the following:
   _Note_: Notice the call to `str(self.base_fs)` which would in turn call the 
`__str__` method of base class `FileSystem`.
   ```
   def __repr__(self):
           return f'SubTreeFileSystem(base_path={self.base_path}, 
base_fs={str(self.base_fs)})'
   ```




-- 
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]


Reply via email to