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



##########
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:
       So the failure on CI is like this:
   
   ```
    >       assert repr(subfs) == f'SubTreeFileSystem(base_path=/another/base/, 
base_fs={subfs.base_fs})'
   E       AssertionError: assert 'SubTreeFileS...f66c4759fb0>)' == 
'SubTreeFileS...f66c4759e70>)'
   E         - SubTreeFileSystem(base_path=/another/base/, 
base_fs=<pyarrow._fs.LocalFileSystem object at 0x7f66c4759e70>)
   E         ?                                                                  
                                     ^^
   E         + SubTreeFileSystem(base_path=/another/base/, 
base_fs=<pyarrow._fs.LocalFileSystem object at 0x7f66c4759fb0>)
   E         ?            
   ```
   So because the `subfs.base_fs` is recreaed each time you access it, the repr 
of those differ. But I don't really understand why it actually passes in some 
builds (and also for you locally?), and not in others.
   
   (but so we will need to make the testing a bit more robust against this 
small expected difference)




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