edponce commented on a change in pull request #11447:
URL: https://github.com/apache/arrow/pull/11447#discussion_r731539352
##########
File path: python/pyarrow/tests/test_fs.py
##########
@@ -587,11 +587,14 @@ def test_subtree_filesystem():
subfs = SubTreeFileSystem('/base', localfs)
assert subfs.base_path == '/base/'
assert subfs.base_fs == localfs
+ assert str(subfs) == 'SubTreeFileSystem: file:/base/'
+ assert repr(subfs) == f'SubTreeFileSystem(base_path=/base/,
base_fs={subfs.base_fs})'
subfs = SubTreeFileSystem('/another/base/', LocalFileSystem())
assert subfs.base_path == '/another/base/'
assert subfs.base_fs == localfs
-
+ assert str(subfs) == 'SubTreeFileSystem: file:/another/base/'
+ assert repr(subfs) == f'SubTreeFileSystem(base_path=/another/base/,
base_fs={subfs.base_fs})'
Review comment:
The reason for getting different object IDs is that the [property
`base_fs` creates another instance of base class
`FileSystem`](https://github.com/apache/arrow/blob/master/python/pyarrow/_fs.pyx#L847-L848)
via the [`wrap()`
method](https://github.com/apache/arrow/blob/master/python/pyarrow/_fs.pyx#L355-L377).
`__repr__` uses `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]