Repository navigation
Implement batch actions. - #32
Merged
Merged
Conversation
|
Coverage decreased (-0.0%) when pulling cfa443437b6012d341518a25a321bf79847fc796 on batch-actions into ab3b951 on develop. |
Contributor
|
Looks good. π’ You may want to add a test that does a Collection.page_size().pages() to ensure that you never run into issues for that case. I would picture a test similar to the test you did for limit() |
This change implements batch actions on collections:
```python
s3.Bucket('boto3').objects.delete()
```
It does the following:
* Create a `CollectionFactory` class to generate subclasses of
`CollectionManager` and `ResourceCollection`.
* Update the `ResourceFactory` to use the new `CollectionFactory`.
* Add a public `pages()` method to collections. This returns entire
pages of resource instances and it used by `__iter__` as well.
* Add batch actions as methods via the new `CollectionFactory`.
* Add a `BatchAction` subclass of `Action` which does the following:
1. Get a page of results from the collection's operation
2. Build parameters for the batch action operation
3. Call the batch action operation
4. Repeat until no more pages
* Makes some previously public members private on `Action` as these
should never have been public.
* Update documentation to include collection classes.
* Add tests to cover the new functionality.
danielgtaylor
force-pushed
the
batch-actions
branch
from
December 8, 2014 19:16
cfa4434 to
30463ab
Compare
Contributor
Author
|
@kyleknap I've rebased onto the latest develop and added a test to ensure |
Contributor
|
Thanks! π’ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change implements batch actions on collections:
It does the following:
CollectionFactoryclass to generate subclasses ofCollectionManagerandResourceCollection.ResourceFactoryto use the newCollectionFactory.pages()method to collections. This returns entirepages of resource instances and it used by
__iter__as well.CollectionFactory.BatchActionsubclass ofActionwhich does the following:Actionas theseshould never have been public.
cc @jamesls, @kyleknap