diff --git a/changes/3212.doc.rst b/changes/3212.doc.rst new file mode 100644 index 0000000000..1754d18c92 --- /dev/null +++ b/changes/3212.doc.rst @@ -0,0 +1,4 @@ +- Add a description on how to create a RemoteStore of a specific filesystem to the `Remote Store` section in `docs\user-guide\storage.rst`. +- State in the docstring of `FsspecStore.from_url` that the filesystem type is inferred from the URL scheme. + +It should help a user handling the case when the type of FsspecStore doesn't match the URL scheme. \ No newline at end of file diff --git a/docs/user-guide/storage.rst b/docs/user-guide/storage.rst index 4215cbaf20..e5a333872e 100644 --- a/docs/user-guide/storage.rst +++ b/docs/user-guide/storage.rst @@ -87,6 +87,16 @@ API. ``storage_options`` can be used to configure the fsspec backend.: >>> zarr.open_group(store=store, mode='r') > +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"). +In case a specific filesystem is needed, one can explicitly create it. For example to create a S3 filesystem: + + >>> import fsspec + >>> fs = fsspec.filesystem( + ... 's3', anon=True, asynchronous=True, + ... client_kwargs={'endpoint_url': "https://noaa-nwm-retro-v2-zarr-pds.s3.amazonaws.com"} + ... ) + >>> store = zarr.storage.FsspecStore(fs) + Memory Store ~~~~~~~~~~~~ diff --git a/src/zarr/storage/_fsspec.py b/src/zarr/storage/_fsspec.py index a1b05a7630..e169eededc 100644 --- a/src/zarr/storage/_fsspec.py +++ b/src/zarr/storage/_fsspec.py @@ -216,7 +216,7 @@ def from_url( allowed_exceptions: tuple[type[Exception], ...] = ALLOWED_EXCEPTIONS, ) -> FsspecStore: """ - Create a FsspecStore from a URL. + Create a FsspecStore from a URL. The type of store is determined from the URL scheme. Parameters ----------