-
Notifications
You must be signed in to change notification settings - Fork 282
fs = s3fs.S3FileSystem(profile_name='profile') TypeError: __init__() got an unexpected keyword argument 'profile_name' #324
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
Comments
Should have been "profile_name" -> "profile" |
Hi Martin! |
Perhaps botocore has a different name here? s3fs uses botocore, not boto3, since the last couple of releases, because the former can be swapped for aiobotocore. |
Hi @martindurant
|
@nivcoh : could you please try with the following change? --- a/s3fs/core.py
+++ b/s3fs/core.py
@@ -301,7 +311,7 @@ class S3FileSystem(AsyncFileSystem):
config_kwargs["signature_version"] = UNSIGNED
conf = AioConfig(**config_kwargs)
if self.session is None:
- self.session = aiobotocore.get_session(**self.kwargs)
+ self.session = aiobotocore.AioSession(**self.kwargs)
s3creator = self.session.create_client('s3', config=conf, **init_kwargs, **client_kwargs)
self._s3 = await s3creator.__aenter__() -edited- |
Thank you @martindurant & @TomAugspurger but it doesn't seem to work. (I tried using both "profile" / "profile_name") here is the full print error: ~\AppData\Local\Programs\Python\Python37\lib\site-packages\fsspec\spec.py in call(cls, *args, **kwargs) ~\AppData\Local\Programs\Python\Python37\lib\site-packages\s3fs\core.py in init(self, anon, key, secret, token, use_ssl, client_kwargs, requester_pays, default_block_size, default_fill_cache, default_cache_type, version_aware, config_kwargs, s3_additional_kwargs, session, username, password, asynchronous, loop, **kwargs) ~\AppData\Local\Programs\Python\Python37\lib\site-packages\fsspec\asyn.py in wrapper(*args, **kwargs) ~\AppData\Local\Programs\Python\Python37\lib\site-packages\fsspec\asyn.py in maybe_sync(func, self, *args, **kwargs) ~\AppData\Local\Programs\Python\Python37\lib\site-packages\fsspec\asyn.py in sync(loop, func, callback_timeout, *args, **kwargs) ~\AppData\Local\Programs\Python\Python37\lib\site-packages\fsspec\asyn.py in f() ~\AppData\Local\Programs\Python\Python37\lib\site-packages\s3fs\core.py in _connect(self, kwargs) ~\AppData\Local\Programs\Python\Python37\lib\site-packages\aiobotocore\session.py in create_client(self, *args, **kwargs) TypeError: _create_client() got an unexpected keyword argument 'profile' |
Dod you call as |
s3_fs = S3FileSystem(anon=False, client_kwargs={'profile_name':"prod"}) |
changing to |
OK! |
when will you expect this fix to be released? |
#351 is adding this, but there are ongoing problems with aiobotocore interaction for regional buckets. I would like to see those fixed for a bugfix release, so hoping ~days. |
this will be great :) Thank you for your hard work & kind support |
What happened:
Wanted to use s3fs with an AWS profilename.
What you expected to happen:
Connect and work with s3_fs.
Minimal Complete Verifiable Example:
tried:
TypeError: init() got an unexpected keyword argument 'profile_name'
NoCredentialsError: Unable to locate credentials
TypeError: create_client() got an unexpected keyword argument 'profile_name'
NoCredentialsError: Unable to locate credentials
TypeError: Got unexpected keyword argument 'profile_name
Anything else we need to know?
Multiple past issues states that kwargs should work
Environment:
The text was updated successfully, but these errors were encountered: