Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions python/pyarrow/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,6 @@ def _ensure_filesystem(fs):
# If the arrow filesystem was subclassed, assume it supports the full
# interface and return it
if not issubclass(fs_type, FileSystem):
for mro in inspect.getmro(fs_type):
if mro.__name__ == 'S3FileSystem':
return S3FSWrapper(fs)

if "fsspec" in sys.modules:
fsspec = sys.modules["fsspec"]
if isinstance(fs, fsspec.AbstractFileSystem):
Expand All @@ -455,6 +451,10 @@ def _ensure_filesystem(fs):
# filesystems (which should be compatible with our legacy fs)
return fs

for mro in inspect.getmro(fs_type):
if mro.__name__ == 'S3FileSystem':
return S3FSWrapper(fs)

raise OSError('Unrecognized filesystem: {}'.format(fs_type))
else:
return fs
Expand Down