Use fsspec as default backend in etils.epath to connect to GCS#11215
Draft
ankitaluthra1 wants to merge 3 commits into
Draft
Use fsspec as default backend in etils.epath to connect to GCS#11215ankitaluthra1 wants to merge 3 commits into
ankitaluthra1 wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thank you for your contribution!
Please read https://www.tensorflow.org/datasets/contribute#pr_checklist to make sure your PR follows the guidelines.
Add Dataset / Backend Fix
dataset_info.jsonGist:Description
This PR enables the use of
fsspecandgcsfsas the backend for Google Cloud Storage (GCS) operations inetils.epathto support data loading from GCS Rapid buckets.With this change, if a user sets
GCS_PREFER_FSSPEC=truein their environment, it will automatically setEPATH_PREFER_FSSPEC=trueduring initialization, switching the backend to_FileSystemSpecBackend.Changes included:
tensorflow_datasets/__init__.py: Added environment variable checkif os.environ.get('GCS_PREFER_FSSPEC') == 'true':to setos.environ['EPATH_PREFER_FSSPEC'] = 'true'.setup.py: Added'gcs_prefer_fsspec': ['fsspec', 'gcsfs']toEXTRAS.tensorflow_datasets/import_test.py: Added teststest_gcs_prefer_fsspec_trueandtest_gcs_prefer_fsspec_falseto ensure the correct backend initializes.Validation:
These changes were validated by successfully loading the
mnistdataset stored in a Rapid bucket and Standard bucket. Data loading was successful after these changes were applied, confirming that thefsspecbackend correctly handles reading from Rapid and existing standard storage class buckets.Checklist
__init__.pydownload_and_preparesuccessfully (Note: verified via GCS bucket)BibTeXformatscipy), use lazy_imports (if applicable)