

def test_summary_with_mean():
    ((chunk, chunk_expr), (agg, agg_expr)) = split(t, summary(a=t.amount.count(), b=(t.id.mean() + 1)))
    assert (chunk.schema == t.schema)
    assert chunk_expr.isidentical(summary(a=chunk.amount.count(), b_total=chunk.id.sum(), b_count=chunk.id.count(), keepdims=True))
    expected = summary(a=agg.a.sum(), b=((agg.b_total.sum() / agg.b_count.sum()) + 1))
    assert agg_expr.isidentical(expected)

dataset/ETHPy150Open blaze/blaze/blaze/expr/tests/test_split.py test_summary_with_mean/original