Repository navigation
Expose all resources on a service resource. - #60
Merged
Merged
Conversation
This change brings back behavior that was removed in Boto 3 - 0.0.7
and allows things like the following to work again:
```python
import boto3
s3 = boto3.resource('s3')
obj = s3.Object('bucket-name', 'key')
```
It is possible to define many subresources on a service that have the same resource type, e.g. `Queue`, `PriorityQueue`, and `Stack` might all be implemented as a single resource type with different default values. We need to make sure all of these are exposed on the service resource.
Contributor
There was a problem hiding this comment.
Where is this else coming from? It does not look in line with any if statement.
Contributor
Author
There was a problem hiding this comment.
It's from the for loop. If it never breaks, then the else is executed. I've since removed it to simplify the code and fix a potential case I hadn't considered so it should now be easier to understand.
Contributor
|
Looks good. π’ Thanks for fixing the comments I made earlier |
|
Changes Unknown when pulling e2d3706 on service-subresources into * on develop*. |
Contributor
|
Thanks! π’ |
danielgtaylor
added a commit
that referenced
this pull request
Feb 10, 2015
Expose all resources on a service resource.
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 brings back behavior that was removed in Boto 3 - 0.0.7
and allows things like the following to work again:
This is required to gain direct access to some resources that are not exposed as subresources nor references (think something like
sqs.Message, which you can now only get fromsqs.Queue('url').receive_messages() => [Message(...)]Without the change in this pull request there is no way to instantiate a message instance yourself).cc @jamesls @kyleknap