According to the boto3 docs, the limit
argument in query
allows you to to limit the number of evaluated objects in your DynamoDB table/GSI.
However, LastEvaluatedKey
isn't returned when the desired limit is reached and therefore a client that would like to limit the number of fetched results will fail to do so
consider the following code:
while True:
query_result = self._dynamodb_client.query(**query_kwargs)
for dynamodb_formatted_item in query_result["Items"]:
yield self._convert_dict_from_dynamodb_key_names(
from_dynamodb_formatted_dict_to_dict(dynamodb_formatted_item)
)
if "LastEvaluatedKey" not in query_result:
return
Am I missing something here ? Is this a bug in the Boto library ?