From 5da5c571a950e59982cf9f15b42ac32452e7afe9 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 20 May 2015 09:36:40 +0200 Subject: [PATCH] filtering the items is needed because of defaultdict is not threadsafe and returns an empty dict which results in an exception here --- moto/dynamodb2/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moto/dynamodb2/models.py b/moto/dynamodb2/models.py index bc79b7e9..f24d7398 100644 --- a/moto/dynamodb2/models.py +++ b/moto/dynamodb2/models.py @@ -220,7 +220,7 @@ class Table(object): results = [] last_page = True # Once pagination is implemented, change this - possible_results = [item for item in list(self.all_items()) if item.hash_key == hash_key] + possible_results = [item for item in list(self.all_items()) if isinstance(item, Item) and item.hash_key == hash_key] if range_comparison: for result in possible_results: if result.range_key.compare(range_comparison, range_objs):