def sort_by(self, expr, sort_exprs):
    sort_exprs = util.promote_list(sort_exprs)
    resolved_keys = _maybe_convert_sort_keys(self.table, sort_exprs)
    if (resolved_keys and self.table._is_valid(resolved_keys)):
        return Aggregation(self.table, self.metrics, by=self.by, having=self.having, predicates=self.predicates, sort_keys=(self.sort_keys + resolved_keys))
    return Selection(expr, [], sort_keys=sort_exprs)
def sort_by(self, expr, sort_exprs):
    sort_exprs = util.promote_list(sort_exprs)
    resolved_keys = _maybe_convert_sort_keys(self.table, sort_exprs)
    if (resolved_keys and self.table._is_valid(resolved_keys)):
        return Aggregation(self.table, self.metrics, by=self.by, having=self.having, predicates=self.predicates, sort_keys=(self.sort_keys + resolved_keys))
    return Selection(expr, [], sort_keys=sort_exprs)