def valid_grouper(expr):
    ds = expr.dshape
    measure = ds.measure
    return (iscollection(ds) and
            (isscalar(getattr(measure, 'key', measure)) or
             (isrecord(measure) and not is_nested_record(measure))))
dataset/ETHPy150Open blaze/blaze/blaze/compute/sql.py/valid_grouper/original