Skip to content

DOC: Show how to authenticate with fsspec's storage_options dict #2995

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

Open
Kezzsim opened this issue Apr 17, 2025 · 0 comments
Open

DOC: Show how to authenticate with fsspec's storage_options dict #2995

Kezzsim opened this issue Apr 17, 2025 · 0 comments
Labels
documentation Improvements to the documentation help wanted Issue could use help from someone with familiarity on the topic

Comments

@Kezzsim
Copy link

Kezzsim commented Apr 17, 2025

Describe the issue linked to the documentation

In the Zarr storage guide there is an example showing how to connect to an S3 bucket anonymously and read data. This is great! Yet I think a lot of people experimenting with this feature on their local machines using minio will have problems authenticating and testing using this example. I've combed through massive amounts of fsspec documentation yet I can't find what keys are acceptable for this in storage_options.

I've tried:

import zarr
import numpy as np

store = zarr.storage.FsspecStore.from_url(
    'http://localhost:9000',
    storage_options={
        'key': 'minioadmin',
        'secret': 'minioadmin'
        }
)
zarr.open_group(store=store, mode='w')

along with:

storage_options={
    'username': 'minioadmin',
    'password': 'minioadmin'
}

I know I can get a solution working with s3fs:

import zarr
import s3fs
import numpy as np

bucket = "buck"
name = "sample"

s3 = s3fs.S3FileSystem(
    client_kwargs={"endpoint_url": "http://localhost:9000"},
    key="minioadmin",
    secret="minioadmin",
    use_ssl=False,
)
s3store = s3fs.S3Map(root=f'{bucket}/{name}', s3=s3)

However, this is nowhere near as sleek and integrated as the Zarr docs make it seem.

Suggested fix for documentation

We're looking to avoid errors like:
TypeError: ClientSession._request() got an unexpected keyword argument 'secret'
Suggest a way we can add documentation to let users know what keys are valid in storage_options or where auth should otherwise be specified.

@Kezzsim Kezzsim added documentation Improvements to the documentation help wanted Issue could use help from someone with familiarity on the topic labels Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements to the documentation help wanted Issue could use help from someone with familiarity on the topic
Projects
None yet
Development

No branches or pull requests

1 participant