GithubHelp home page GithubHelp logo

Comments (5)

martindurant avatar martindurant commented on August 11, 2024 3

Currently, the two timeouts are class attributes only. You could set them on the class:

s3fs.S3FileSystem.read_timeout = 3600

or on an instance

 s3 = s3fs.S3FileSystem(...)
 s3.read_timeout = 3600

It would be reasonable to accept these timeouts as keywords to __init__ or as keys in config_kwargs.

from s3fs.

Vslira avatar Vslira commented on August 11, 2024 1

Just mentioning if someone else has this problem: following martindurant's answer I could fix it, but only by changing the class attribute before instantiating a S3FileSystem object. Trying to set read_timeout = 3600 to an already created object didn't work

from s3fs.

kinzleb avatar kinzleb commented on August 11, 2024

Also as I mention in the comments of the code I tried above, I also tried setting the read_timeout like follows but it resulted in a different error:

import s3fs
fs = s3fs.S3FileSystem(config_kwargs={'read_timeout':3600})

Error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-c9fe9ad1bb2a> in <module>()
      1 # show the files (requires credentials file for aws access)
      2 import s3fs
----> 3 fs = s3fs.S3FileSystem(config_kwargs={'read_timeout':3600})

~/notebook-env/lib/python3.6/site-packages/s3fs/core.py in __init__(self, anon, key, secret, token, use_ssl, client_kwargs, requester_pays, default_block_size, default_fill_cache, config_kwargs, s3_additional_kwargs, **kwargs)
    153         self.s3_additional_kwargs = s3_additional_kwargs or {}
    154         self.use_ssl = use_ssl
--> 155         self.s3 = self.connect()
    156         self._kwargs_helper = ParamKwargsHelper(self.s3)
    157         self._singleton[0] = self

~/notebook-env/lib/python3.6/site-packages/s3fs/core.py in connect(self, refresh)
    209                 conf = Config(connect_timeout=self.connect_timeout,
    210                               read_timeout=self.read_timeout,
--> 211                               **self.config_kwargs)
    212                 self.session = boto3.Session(self.key, self.secret, self.token,
    213                                              **self.kwargs)

TypeError: type object got multiple values for keyword argument 'read_timeout'

from s3fs.

kinzleb avatar kinzleb commented on August 11, 2024

Oh gotcha, I didn't realize I could just set those using the class attributes. That will work for me, thanks for the time!

from s3fs.

Chrisjw42 avatar Chrisjw42 commented on August 11, 2024

I have now ustilised the method above, but initially when looking at the docs, I had tried to pass these as keys in config_kwargs, but that actually throws an error. If you pass these, the boto3 client (I think) tried to set the value twice. It's not really an issue for me but I thought you might want to hear about it.

from s3fs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.