sq = session.query(Run.session_id, func.count(Run.session_id).label('count')
    ).group_by(Run.session_id).subquery()
result = session.query(Session, sq.c.count).join(sq, sq.c.session_id ==
    Session.id).all()
SQLAlchemy query for object with count of relationship