terricain / aioboto3

Wrapper to use boto3 resources with the aiobotocore async backend
Apache License 2.0
735 stars 75 forks source link

'async for' requires an object with __aiter__ method, got s3.Bucket.objectsCollection #188

Closed parinmaru2 closed 4 years ago

parinmaru2 commented 4 years ago

Problem:

I am using aioboto3 to create s3 resource. And then I call s3 objects filter method:

my_bucket = self.s3_resource.Bucket(bucket_name)
response = my_bucket.objects.filter(Prefix=remote_directory_prefix)

I can't loop/iterate over this response:

async for r in response:

Above async for throws this exception: 'async for' requires an object with aiter method, got s3.Bucket.objectsCollection

Analysis It seems s3.Bucket.objectsCollection doesn't implement aiter() method

terricain commented 4 years ago

Think this'll be solved by either #181 or #186

terricain commented 4 years ago

Should be fixed by v6.5.0 can you test it out? If it doesn't work can you reopen this ticket with the issue.

parinmaru2 commented 4 years ago

Should be fixed by v6.5.0 can you test it out? If it doesn't work can you reopen this ticket with the issue.

Thanks @terrycain Tested with latest version and this seems to have been fixed. Thanks again.