Skip to content
Merged
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
9 changes: 5 additions & 4 deletions src/datasets/filesystems/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ def is_remote_filesystem(fs: fsspec.AbstractFileSystem) -> bool:
fs (`fsspec.spec.AbstractFileSystem`):
An abstract super-class for pythonic file-systems, e.g. `fsspec.filesystem(\'file\')` or [`datasets.filesystems.S3FileSystem`].
"""
if fs is not None and fs.protocol != "file":
return True
else:
return False
if fs is not None:
protocols = (p,) if isinstance(p := fs.protocol, str) else p
if "file" not in protocols:
return True
return False


def rename(fs: fsspec.AbstractFileSystem, src: str, dst: str):
Expand Down