Comments (5)
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.
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.
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.
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.
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)
- It is not possible to use synchronous and asynchronous calls together HOT 3
- Confused about using s3fs asynchronously HOT 7
- Failed to check IAM role name HOT 2
- Access Denied when IAM policy give access (Read/Write/Listing) to only a prefix area HOT 14
- difficult to perform delete_object request instead of delete_objects using S3FileSystem HOT 7
- S3fs doesn't check again if file exists HOT 4
- Inconsistent recursive `put` behavior when running an identical command twice successively HOT 1
- open_async file is closed on arrival HOT 1
- set_session does not seem to be thread / jobs safe HOT 4
- Random XAmzContentSHA256Mismatch Errors HOT 6
- Access denied when providing an authentication token associated with a set of permission policies to S3FileSystem HOT 3
- calling flush on s3fs fails HOT 2
- s3fs 2024.3.0 fails reading glob patterns through pandas HOT 12
- Question: is awscrt useful ? HOT 2
- Errors when installing s3fs on Sagemaker Studio HOT 1
- Why isn't Pathlib supported yet? HOT 1
- Working example of using Async/Await HOT 7
- Custom s3 compatible https endpoint not working, port forwarded to localhost works HOT 9
- How to Increase async httpconnection limit? HOT 7
- Does aioboto3 Support Authentication with EC2 IAM Roles? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from s3fs.