Open alastair opened 9 years ago
I ran into this issue too. It's kind of a hack but I think it should work by setting something arbitrary like connection="This will get overwritten"
in the Table init method. That way boto won't instantiate a new connection, and flask-dynamo patches table.connection to be its own connection later anyway here.
I'll be updating this later tonight. Been traveling and neglected my issues >< Sorry about that! <333
Anyone have a good suggestion of how to do this, exactly? I'm trying to think of a clean way to make this happen.
Also having this issue right now. Would it be best to offer a sub-classed version of boto.dynamodb2.table.Table?
The table configuration for flask-dynamo requires a valid connection to be created - This block of code
Causes the following boto code to create a new connection with no parameters: https://github.com/boto/boto/blob/48c5d178d83bc5f2aa6a8e488396e41b2d867ceb/boto/dynamodb2/table.py#L106
If you have no default credentials in
~/.boto
, then this fails with a really cryptic error:My expectation is that credentials in the flask configuration would be used for configuration instead of
~/.boto
or env variables. This is especially unusual if I have local dynamodb configured - it will still go and make a connection with my live credentials before falling back to using the local database.