def test_summary():
    t = Symbol('t', 'var * {id: int32, name: string, amount: int32}')
    s = summary(total=t.amount.sum(), num=t.id.count())
    assert s.dshape == dshape('{num: int32, total: int64}')
    assert hash(s)
    assert eval(str(s)).isidentical(s)

    assert 'summary(' in str(s)
    assert 'total=' in str(s)
    assert 'num=' in str(s)
    assert str(t.amount.sum()) in str(s)

    assert not summary(total=t.amount.sum())._child.isidentical(
            t.amount.sum())
    assert iscollection(summary(total=t.amount.sum() + 1)._child.dshape)
dataset/ETHPy150Open blaze/blaze/blaze/expr/tests/test_symbol.py/test_summary/original