

def apply(self, data, sort=True):
    group_by = self.group_bys_cols[0]
    if sort:
        data = sorted(data, key=self.attrgetter(group_by))
    result = []
    for item in data:
        result_item = [self.format_columns(self.attrgetter(group_by)(item))]
        for aggr_by_col in self.aggr_by_cols:
            result_item.append(self.attrgetter(aggr_by_col)(item))
        result.append(result_item)
    return result

dataset/ETHPy150Open dpgaspar/Flask-AppBuilder/flask_appbuilder/models/group.py DirectProcessData.apply/original