Skip to content

TypeError: ClientSession._request() got an unexpected keyword argument 's3' #1925

@codingl2k1

Description

@codingl2k1

I have a list of URLs that are mixed with different schemes, some in the format s3:// and others in https://. I want to use one global storage option to read them all. However, the HTTP backend is attempting to use the S3 storage option.

Different protocol backends should only use their corresponding protocol storage options.

import fsspec

storage_options = {
    "s3": {
        "key": "My key",
        "secret": "My secret",
        "use_ssl": True,
    },
}

for url in url_list:
    with fsspec.open(url, "rb", **storage_options) as f:
        data = f.read()
        print(data)

error:

    def get(
        self, url: StrOrURL, *, allow_redirects: bool = True, **kwargs: Any
    ) -> "_RequestContextManager":
        """Perform HTTP GET request."""
        return _RequestContextManager(
>           self._request(
                hdrs.METH_GET, url, allow_redirects=allow_redirects, **kwargs
            )
        )
E       TypeError: ClientSession._request() got an unexpected keyword argument 's3'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions