Thanks for the great package - finding it super useful! We use AWS_PROFILEs and sometimes need to switch between profiles to access different buckets. We spotted the _cleanup() method in the tests but can't use it because the way the resource is created doesn't use the Session and therefore will always use the profile at the time that boto3 is imported (or, at least, this is my understanding). The following code snippet works if you change default_resource to return boto3.Session().resource('s3').
I've made a PR which passes the tests. I'm assuming that you wouldn't want to provide some sort of cache clearing / cleanup utility to the users, but I'm happy to implement it myself given that it's relatively easy.
Hi,
Thanks for the great package - finding it super useful! We use AWS_PROFILEs and sometimes need to switch between profiles to access different buckets. We spotted the
_cleanup()
method in the tests but can't use it because the way the resource is created doesn't use the Session and therefore will always use the profile at the time thatboto3
is imported (or, at least, this is my understanding). The following code snippet works if you changedefault_resource
to returnboto3.Session().resource('s3')
.I've made a PR which passes the tests. I'm assuming that you wouldn't want to provide some sort of cache clearing / cleanup utility to the users, but I'm happy to implement it myself given that it's relatively easy.