From 8b7875ec02a6387e15300ac75a8fa4a0b35c1d97 Mon Sep 17 00:00:00 2001 From: William Richard Date: Wed, 6 Jun 2018 12:56:19 -0400 Subject: [PATCH] Ensure that table.global_indexes and table.indexes are lists --- moto/dynamodb2/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/moto/dynamodb2/models.py b/moto/dynamodb2/models.py index c4aa1023..db6bf04a 100644 --- a/moto/dynamodb2/models.py +++ b/moto/dynamodb2/models.py @@ -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):