fix for scanning without filter
This commit is contained in:
parent
d29ca8503e
commit
a5eaaaad51
@ -244,7 +244,7 @@ class DynamoHandler(object):
|
||||
name = body['TableName']
|
||||
|
||||
filters = {}
|
||||
scan_filters = body['ScanFilter']
|
||||
scan_filters = body.get('ScanFilter', {})
|
||||
for attribute_name, scan_filter in scan_filters.iteritems():
|
||||
# Keys are attribute names. Values are tuples of (comparison, comparison_value)
|
||||
comparison_operator = scan_filter["ComparisonOperator"]
|
||||
|
@ -348,6 +348,9 @@ def test_scan():
|
||||
)
|
||||
item.put()
|
||||
|
||||
results = table.scan()
|
||||
results.response['Items'].should.have.length_of(3)
|
||||
|
||||
results = table.scan(scan_filter={'SentBy': condition.EQ('User B')})
|
||||
results.response['Items'].should.have.length_of(1)
|
||||
|
||||
|
@ -291,6 +291,9 @@ def test_scan():
|
||||
)
|
||||
item.put()
|
||||
|
||||
results = table.scan()
|
||||
results.response['Items'].should.have.length_of(3)
|
||||
|
||||
results = table.scan(scan_filter={'SentBy': condition.EQ('User B')})
|
||||
results.response['Items'].should.have.length_of(1)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user