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



##########
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:
       > I don't have an idea how to make it more robust in this case.
   
   I think the trick could be to avoid comparing that part of the string. For 
example, we know that it always is at the end, so we could slice off the last 
part, and only compare the remainder. Or something like `assert 
repr(subfs).startswith("SubTreeFileSystem(base_path=/another/base/, 
base_fs=<pyarrow._fs.LocalFileSystem"`.




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