Returning distinct rows in SQLAlchemy with SQLite,session.query(Tag).distinct(Tag.name).group_by(Tag.name).count()