From 4e0eaf4b1a257b1a08bdacb32d95cd23dc9ccea5 Mon Sep 17 00:00:00 2001 From: Pierre Marcenac Date: Tue, 23 Jul 2024 01:14:36 -0700 Subject: [PATCH] Use fsspec as the default backend in OSS. PiperOrigin-RevId: 655066077 --- CHANGELOG.md | 6 ++++++ etils/epath/gpath.py | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09e166f5..a5266518 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,12 @@ Changelog follow https://keepachangelog.com/ format. ## [Unreleased] +* `epath`: + * [fsspec](https://filesystem-spec.readthedocs.io/en/latest/) is now the + default backend even if TensorFlow is installed. This means that you + need to install [gcsfs](https://gcsfs.readthedocs.io/en/latest/) or + [s3fs](https://github.com/s3fs-fuse/s3fs-fuse) to read from respectively + GCS or S3. * `epy`: * Add `epy.is_test` to check whether we're running in a test environment. * Add `epy.typing.Json`. diff --git a/etils/epath/gpath.py b/etils/epath/gpath.py index 02a8e869..172d1b5d 100644 --- a/etils/epath/gpath.py +++ b/etils/epath/gpath.py @@ -110,11 +110,6 @@ def _uri_scheme(self) -> Optional[str]: def _backend(self) -> backend_lib.Backend: try: backend = _PREFIX_TO_BACKEND[self._uri_scheme] - # Choose tf_backend if tf is installed. We don't use FSSpec by default - # for retro-compatibility, because needed dependencies (gcsfs or s3fs) - # may not be installed. fsspec_backend was indeed introduced later. - if _is_tf_installed() and self._uri_scheme is not None: - return backend_lib.tf_backend return backend except KeyError: supported = ', '.join(f'`{k}://`' for k in _PREFIX_TO_BACKEND)