def test_reduction(): t = TableSymbol("t", "{name: string, amount: int32}") r = sum(t["amount"]) assert r.dshape in (dshape("int64"), dshape("{amount: int64}"), dshape("{amount_sum: int64}")) assert "amount" not in str(t.count().dshape) assert t.count().dshape[0] in (int32, int64) assert "int" in str(t.count().dshape) assert "int" in str(t.nunique().dshape) assert "string" in str(t["name"].max().dshape) assert "string" in str(t["name"].min().dshape) assert "string" not in str(t.count().dshape) t = TableSymbol("t", "{name: string, amount: real, id: int}") assert "int" in str(t["id"].sum().dshape) assert "int" not in str(t["amount"].sum().dshape)
def test_reduction(): t = TableSymbol('t', '{name: string, amount: int32}') r = sum(t['amount']) assert r.dshape in (dshape('int64'), dshape('{amount: int64}'), dshape('{amount_sum: int64}')) assert 'amount' not in str(t.count().dshape) assert t.count().dshape[0] in (int32, int64) assert 'int' in str(t.count().dshape) assert 'int' in str(t.nunique().dshape) assert 'string' in str(t['name'].max().dshape) assert 'string' in str(t['name'].min().dshape) assert 'string' not in str(t.count().dshape) t = TableSymbol('t', '{name: string, amount: real, id: int}') assert 'int' in str(t['id'].sum().dshape) assert 'int' not in str(t['amount'].sum().dshape)