Beispiel #1
0
def test_discover_dshape_symbol(ds):
    t_ds = TableSymbol('t', dshape=ds)
    assert t_ds.fields is not None

    t_sch = TableSymbol('t', dshape=ds.subshape[0])
    assert t_sch.fields is not None

    assert t_ds.isidentical(t_sch)
Beispiel #2
0
def test_discover_dshape_symbol(ds):
    t_ds = TableSymbol('t', dshape=ds)
    assert t_ds.fields is not None

    t_sch = TableSymbol('t', dshape=ds.subshape[0])
    assert t_sch.fields is not None

    assert t_ds.isidentical(t_sch)
Beispiel #3
0
def test_serializable():
    t = TableSymbol('t', '{id: int, name: string, amount: int}')
    import pickle
    t2 = pickle.loads(pickle.dumps(t))

    assert t.isidentical(t2)

    s = TableSymbol('t', '{id: int, city: string}')
    expr = join(t[t.amount < 0], s).sort('id').city.head()
    expr2 = pickle.loads(pickle.dumps(expr))

    assert expr.isidentical(expr2)
Beispiel #4
0
def test_serializable():
    t = TableSymbol('t', '{id: int, name: string, amount: int}')
    import pickle
    t2 = pickle.loads(pickle.dumps(t))

    assert t.isidentical(t2)

    s = TableSymbol('t', '{id: int, city: string}')
    expr = join(t[t.amount < 0], s).sort('id').city.head()
    expr2 = pickle.loads(pickle.dumps(expr))

    assert expr.isidentical(expr2)