def test_distinct_name(): t = TableSymbol('t', '{id: int32, name: string}') assert t.name.isidentical(t['name']) assert t.distinct().name.isidentical(t.distinct()['name']) assert t.id.distinct()._name == 'id' assert t.name._name == 'name'
def test_distinct_name(): t = TableSymbol("t", "{id: int32, name: string}") assert t.name.isidentical(t["name"]) assert t.distinct().name.isidentical(t.distinct()["name"]) assert t.id.distinct()._name == "id" assert t.name._name == "name"
def test_Distinct(): t = TableSymbol('t', '{name: string, amount: int32}') r = distinct(t['name']) print(r.dshape) assert r.dshape == dshape('var * {name: string}') r = t.distinct() assert r.dshape == t.dshape
def test_Distinct(): t = TableSymbol('t', '{name: string, amount: int32}') r = distinct(t['name']) print(r.dshape) assert r.dshape == dshape('var * string') assert r._name == 'name' r = t.distinct() assert r.dshape == t.dshape
def test_Distinct(): t = TableSymbol("t", "{name: string, amount: int32}") r = distinct(t["name"]) print(r.dshape) assert r.dshape == dshape("var * string") assert r._name == "name" r = t.distinct() assert r.dshape == t.dshape
def test_Distinct(): x = np.array([('Alice', 100), ('Alice', -200), ('Bob', 100), ('Bob', 100)], dtype=[('name', 'S5'), ('amount', 'i8')]) t = TableSymbol('t', '{name: string, amount: int64}') assert eq(compute(t['name'].distinct(), x), np.unique(x['name'])) assert eq(compute(t.distinct(), x), np.unique(x))