Ensure that table.global_indexes and table.indexes are lists

This commit is contained in:
William Richard 2018-06-06 12:56:19 -04:00
parent 014fbbb8cb
commit 8b7875ec02
No known key found for this signature in database
GPG Key ID: F7F8BA4DDBE1ABED

View File

@ -706,7 +706,9 @@ class DynamoDBBackend(BaseBackend):
gsis_by_name[gsi_to_create['IndexName']] = gsi_to_create
table.global_indexes = gsis_by_name.values()
# in python 3.6, dict.values() returns a dict_values object, but we expect it to be a list in other
# parts of the codebase
table.global_indexes = list(gsis_by_name.values())
return table
def put_item(self, table_name, item_attrs, expected=None, overwrite=False):