I've got a DynamoDB database set up with string hash key and range keys. This works:
>>> x = table.query(hash_key='asdf@asdf.com', range_key_condition=BEGINS_WITH("20"),
request_limit=5)
>>> [i for i in x]
[{u'x-entry-page': ...
This doesn't, and I can't figure out why not:
>>> x = table.query(hash_key='asdf@asdf.com', range_key_condition=BEGINS_WITH("20"),
attributes_to_get=[u'x-start-time'], request_limit=5)
>>> [i for i in x]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/site-packages/boto-2.3.0-py2.7.egg/boto/dynamodb/layer2.py", line 588, in query
yield item_class(table, attrs=item)
File "/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/site-packages/boto-2.3.0-py2.7.egg/boto/dynamodb/item.py", line 45, in __init__
raise DynamoDBItemError('You must supply a hash_key')
boto.dynamodb.exceptions.DynamoDBItemError: BotoClientError: You must supply a hash_key
This makes very little sense to me. I clearly am supplying a hash key. I can't tell what the issue is just by looking at the Boto source. The attribute in question is definitely present in every record (not that that should throw an error).
Any suggestions? Thanks!