Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove HfFileSystem and deprecate S3FileSystem #6052

Merged
merged 3 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
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
6 changes: 2 additions & 4 deletions src/datasets/arrow_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1383,8 +1383,7 @@ def save_to_disk(
storage_options: Optional[dict] = None,
):
"""
Saves a dataset to a dataset directory, or in a filesystem using either `s3fs.S3FileSystem` or
any implementation of `fsspec.spec.AbstractFileSystem`.
Saves a dataset to a dataset directory, or in a filesystem using any implementation of `fsspec.spec.AbstractFileSystem`.

For [`Image`] and [`Audio`] data:

Expand Down Expand Up @@ -1601,8 +1600,7 @@ def load_from_disk(
) -> "Dataset":
"""
Loads a dataset that was previously saved using [`save_to_disk`] from a dataset directory, or from a
filesystem using either `s3fs.S3FileSystem` or any implementation of
`fsspec.spec.AbstractFileSystem`.
filesystem using any implementation of `fsspec.spec.AbstractFileSystem`.

Args:
dataset_path (`str`):
Expand Down
6 changes: 2 additions & 4 deletions src/datasets/dataset_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -1199,8 +1199,7 @@ def save_to_disk(
storage_options: Optional[dict] = None,
):
"""
Saves a dataset dict to a filesystem using either [`~filesystems.S3FileSystem`] or
`fsspec.spec.AbstractFileSystem`.
Saves a dataset dict to a filesystem using `fsspec.spec.AbstractFileSystem`.

For [`Image`] and [`Audio`] data:

Expand Down Expand Up @@ -1293,8 +1292,7 @@ def load_from_disk(
storage_options: Optional[dict] = None,
) -> "DatasetDict":
"""
Load a dataset that was previously saved using [`save_to_disk`] from a filesystem using either
[`~filesystems.S3FileSystem`] or `fsspec.spec.AbstractFileSystem`.
Load a dataset that was previously saved using [`save_to_disk`] from a filesystem using `fsspec.spec.AbstractFileSystem`.

Args:
dataset_dict_path (`str`):
Expand Down
93 changes: 0 additions & 93 deletions src/datasets/filesystems/hffilesystem.py

This file was deleted.

3 changes: 3 additions & 0 deletions src/datasets/filesystems/s3filesystem.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import s3fs

from ..utils.deprecation_utils import deprecated


@deprecated("Use s3fs.S3FileSystem instead.")
class S3FileSystem(s3fs.S3FileSystem):
"""
`datasets.filesystems.S3FileSystem` is a subclass of [`s3fs.S3FileSystem`](https://s3fs.readthedocs.io/en/latest/api.html).
Expand Down
3 changes: 1 addition & 2 deletions src/datasets/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -2158,8 +2158,7 @@ def load_from_disk(
) -> Union[Dataset, DatasetDict]:
"""
Loads a dataset that was previously saved using [`~Dataset.save_to_disk`] from a dataset directory, or
from a filesystem using either [`~datasets.filesystems.S3FileSystem`] or any implementation of
`fsspec.spec.AbstractFileSystem`.
from a filesystem using any implementation of `fsspec.spec.AbstractFileSystem`.

Args:
dataset_path (`str`):
Expand Down