def aggregate_failed(self) -> List:
        """Count the number of failed jobs per category (name)."""
        categories = self.session.query(
            self.Job.name.label('name'),
            sqa.func.count(self.Job.id).label('count')
        ).filter(self.Job.status != 'cancelled').group_by(self.Job.name).all()
        data = [{'name': category.name, 'count': category.count} for category in categories]
        return data
Count the number of failed jobs per category (name).