From cd666758f609e1067cf182880e7c4dd7525e4732 Mon Sep 17 00:00:00 2001 From: IVIURRAY Date: Thu, 27 Jun 2019 20:13:36 +0100 Subject: [PATCH] one liner --- moto/dynamodb2/models.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/moto/dynamodb2/models.py b/moto/dynamodb2/models.py index fb34e19cc..bfbb654b4 100644 --- a/moto/dynamodb2/models.py +++ b/moto/dynamodb2/models.py @@ -985,8 +985,7 @@ class DynamoDBBackend(BaseBackend): else: filter_expression = Op(None, None) # Will always eval to true - projection_expression = ','.join([expr_names[attr] if attr in expr_names else attr - for attr in projection_expression.replace(' ', '').split(',')]) + projection_expression = ','.join([expr_names.get(attr, attr) for attr in projection_expression.replace(' ', '').split(',')]) return table.scan(scan_filters, limit, exclusive_start_key, filter_expression, index_name, projection_expression)