Skip to content

Commit 378d5af

Browse files
bevilacqcd-v-b
andauthored
Update documentation of remote store (#3212)
* Add doc about custom remote storage * Add doc about store type to `FsspecStore.from_url` * Add changes * Fix example code * Run pre-commit * Fix typo --------- Co-authored-by: Davis Bennett <davis.v.bennett@gmail.com>
1 parent 111d765 commit 378d5af

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

changes/3212.doc.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- Add a description on how to create a RemoteStore of a specific filesystem to the `Remote Store` section in `docs\user-guide\storage.rst`.
2+
- State in the docstring of `FsspecStore.from_url` that the filesystem type is inferred from the URL scheme.
3+
4+
It should help a user handling the case when the type of FsspecStore doesn't match the URL scheme.

docs/user-guide/storage.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@ API. ``storage_options`` can be used to configure the fsspec backend.:
8787
>>> zarr.open_group(store=store, mode='r')
8888
<Group <FsspecStore(S3FileSystem, noaa-nwm-retro-v2-zarr-pds)>>
8989

90+
The type of filesystem (e.g. S3, https, etc..) is inferred from the scheme of the url (e.g. s3 for "**s3**://noaa-nwm-retro-v2-zarr-pds").
91+
In case a specific filesystem is needed, one can explicitly create it. For example to create a S3 filesystem:
92+
93+
>>> import fsspec
94+
>>> fs = fsspec.filesystem(
95+
... 's3', anon=True, asynchronous=True,
96+
... client_kwargs={'endpoint_url': "https://noaa-nwm-retro-v2-zarr-pds.s3.amazonaws.com"}
97+
... )
98+
>>> store = zarr.storage.FsspecStore(fs)
99+
90100
Memory Store
91101
~~~~~~~~~~~~
92102

src/zarr/storage/_fsspec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def from_url(
216216
allowed_exceptions: tuple[type[Exception], ...] = ALLOWED_EXCEPTIONS,
217217
) -> FsspecStore:
218218
"""
219-
Create a FsspecStore from a URL.
219+
Create a FsspecStore from a URL. The type of store is determined from the URL scheme.
220220
221221
Parameters
222222
----------

0 commit comments

Comments
 (0)