You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that a Collection cannot be filtered like a CollectionManager, even though it has a filter method.
>>> evpc.vpc.instances
ec2.Vpc.instancesCollectionManager(ec2.Vpc(id='vpc-xxxxxx57'), ec2.Instance)
>>> evpc.vpc.instances.filter()
ec2.Vpc.instancesCollection(ec2.Vpc(id='vpc-xxxxxx57'), ec2.Instance)
>>> evpc.vpc.instances.filter().filter(Filter=name_tag_filter('*web*'))
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Users/rballestrini/env/lib/python2.7/site-packages/boto3/resources/collection.py", line 462, in filter
return CollectionManager.filter(self, **kwargs)
TypeError: unbound method filter() must be called with CollectionManager instance as first argument (got ec2.Vpc.
instancesCollection instance instead)
The text was updated successfully, but these errors were encountered:
Hmm. I'm seeing an issue as well, but not the same error as you are getting. I am getting instead: AttributeError: 'ec2.instancesCollection' object has no attribute 'iterator' when I try to chain. Looks like a regression though. If you install version 1.2.1, you should not see the problem anymore.
The code breaks on double chaining because in the CollectionFactory class we assume that we always proxy through the CollectionManager class, but in double chaining we actually store a runtime-generated resource class based from CollectionResource that is used to instantiate the collection, but those collections are using the methods that were attached to the CollectionManager class that we generated at run-time, which even though they have a different interface, they differ in implentation (i.e. no iterator() method existing).
I'm following this guide: http://boto3.readthedocs.org/en/latest/guide/collections.html#chainability
It appears that a Collection cannot be filtered like a CollectionManager, even though it has a
filter
method.The text was updated successfully, but these errors were encountered: