def get_task()

in amazon_polly_async_batch/dynamo.py [0:0]


    def get_task(self, task_id):
        """
        Given a task ID returns that task record from Dynamo. Throws an exception if it's not found.
        :param task_id: a task ID from Polly
        :return: the record
        """
        response = dynamodb.get_item(
            TableName=self.table_name,
            Key={'taskId': {'S': task_id}}
        )
        if 'Item' in response:
            return response['Item']
        else:
            msg = 'Failed to load task {} from DynamoDb table {}'.format(task_id, self.table_name)
            raise Exception(msg)