Example #1
0
File: json.py Project: bopopescu/QC
def pre_compute(expr, data, **kwargs):
    seq = into(Iterator, data, **kwargs)
    leaf = expr._leaves()[0]
    return records_to_tuples(leaf.dshape, seq)
Example #2
0
def test_records_to_tuples_mismatch_passthrough():
    assert records_to_tuples('var * int', 'dummy') == 'dummy'
Example #3
0
def pre_compute(expr, data, **kwargs):
    seq = into(Iterator, data, **kwargs)
    leaf = expr._leaves()[0]
    return records_to_tuples(leaf.dshape, seq)
Example #4
0
def test_records_to_tuples():
    seq = [{'i': 1, 'f': 1.0}, {'i': 2, 'f': 2.0}]
    lst = list(records_to_tuples('var * {i: int, f: float64}', seq))
    assert lst == [(1, 1.0), (2, 2.0)]