'Performs the given query grouped by the fields in group_by with the
given query\'s extra select fields added.  Returns a list of dicts, where
each dict corresponds to single row and contains a key for each grouped
field as well as all of the extra select fields.'

def execute_group_query(self, query, group_by):

    (sql, params) = self._get_group_query_sql(query, group_by)
    cursor = readonly_connection.connection().cursor()
    cursor.execute(sql, params)
    field_names = self._get_column_names(cursor)
    row_dicts = [dict(zip(field_names, row)) for row in cursor.fetchall()]
    return row_dicts
