-
Notifications
You must be signed in to change notification settings - Fork 0
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
Accept caller-provided DynamoDB resources and clients #1
Conversation
LGTM |
There was a problem hiding this 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?
That makes sense, though I haven't dug in deep on the code as of yet. |
doesn't matter to me where |
Since the DynamoDbDriver already has access to the client object, it would
save having to pass it as an extra parameter.
…On Mon, Apr 24, 2017 at 3:59 PM Corey Wright ***@***.***> wrote:
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 environment variables, configuration file, and shared state (ie in
a large application different boto3 resources and client might need
different "defaults").
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB151BoYHv7QD-_zW9O2A23qGShZgHbwks5rzP8pgaJpZM4NGm1E>
.
|
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.
6d70faf
to
3fb6c00
Compare
rebased against master to eliminate merge conflict. |
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).