in spark_scripts/detect_scenes.py [0:0]
def get_batch_file_metadata(table_name, batch_id):
dynamodb = boto3.resource('dynamodb', region_name='eu-west-1')
table = dynamodb.Table(table_name)
response = table.query(
KeyConditions={
'BatchId': {
'AttributeValueList': [batch_id],
'ComparisonOperator': 'EQ'
}
}
)
data = response['Items']
while 'LastEvaluatedKey' in response:
response = table.query(ExclusiveStartKey=response['LastEvaluatedKey'])
data.update(response['Items'])
return data