jorisvandenbossche commented on a change in pull request #7545: URL: https://github.com/apache/arrow/pull/7545#discussion_r450744941
########## File path: python/pyarrow/fs.py ########## @@ -63,6 +63,31 @@ def __getattr__(name): ) +def _ensure_filesystem(filesystem, use_mmap=False): + if isinstance(filesystem, FileSystem): + return filesystem + + # handle fsspec-compatible filesystems + try: + import fsspec + if isinstance(filesystem, fsspec.AbstractFileSystem): Review comment: @martindurant is this the best way to check if a given object is a fsspec filesytem? (I suppose that in theory "fsspec-compatible" doesn't mean it needs to sublcass from fsspec, since it's the spec (the methods) that needs to be implemented. But I don't think we can detect "duck-typed" filesystems) ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org