Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept caller-provided DynamoDB resources and clients #1

Merged
merged 2 commits into from
Apr 25, 2017

Conversation

coreywright
Copy link
Collaborator

@coreywright coreywright commented Apr 24, 2017

Instead of strictly creating DynamoDB resources and clients using
the default session, allow callers to provide one (instead of
requiring the caller to manipulate the default session).

@jfwood
Copy link
Collaborator

jfwood commented Apr 24, 2017

LGTM

Copy link
Owner

@troylar troylar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just move "does_table_exist" to the DynamoDbDriver class?

@jfwood
Copy link
Collaborator

jfwood commented Apr 24, 2017

That makes sense, though I haven't dug in deep on the code as of yet.

@coreywright
Copy link
Collaborator Author

coreywright commented Apr 24, 2017

doesn't matter to me where does_table_exist() reside (though that will reduce the size of the change), but moving it will not address the larger problem (as i see it): allowing the caller to programmatically communicate which dynamodb instance to use, instead of relying on the default session with its shared values (ie in a large application different boto3 resources and clients might need different "default" values) based on environment variables, configuration files, etc.

@troylar
Copy link
Owner

troylar commented Apr 24, 2017 via email

Caller can provide a DynamoDB client instead of callee creating one
using the default session (or requiring the caller to setup the
default session).
Just as RedisProgressManager can be initialized with a
RedisConnection, allow DynamoDbDriver to be initialized with a
DynamoDbResource, instead of relying on the DynamoDB resource created
by the boto3 default session (or requiring the caller to manipulate it
beforehand).

Use the corresponding DynamoDB client to test if the necessary
DynanmoDB tables exist.
@coreywright coreywright force-pushed the dynamodb_programmatically branch from 6d70faf to 3fb6c00 Compare April 25, 2017 23:13
@coreywright
Copy link
Collaborator Author

rebased against master to eliminate merge conflict.

@troylar troylar merged commit 8bb7870 into troylar:master Apr 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants