Esempio n. 1
0
def write_special_types(wf_params, a, b, c, d, e):
    blob = Types.Blob()
    with blob as w:
        w.write("hello I'm a blob".encode('utf-8'))

    csv = Types.CSV()
    with csv as w:
        w.write("hello,i,iz,blob")

    mpcsv = Types.MultiPartCSV()
    with mpcsv.create_part('000000') as w:
        w.write("hello,i,iz,blob")
    with mpcsv.create_part('000001') as w:
        w.write("hello,i,iz,blob2")

    mpblob = Types.MultiPartBlob()
    with mpblob.create_part('000000') as w:
        w.write("hello I'm a mp blob".encode('utf-8'))
    with mpblob.create_part('000001') as w:
        w.write("hello I'm a mp blob too".encode('utf-8'))

    schema = Types.Schema([('a', Types.Integer), ('b', Types.Integer)])()
    with schema as w:
        w.write(_pd.DataFrame.from_dict({'a': [1, 2, 3], 'b': [4, 5, 6]}))
        w.write(_pd.DataFrame.from_dict({'a': [3, 2, 1], 'b': [6, 5, 4]}))

    a.set(blob)
    b.set(csv)
    c.set(mpcsv)
    d.set(mpblob)
    e.set(schema)
Esempio n. 2
0
 def test_write(wf_params, a):
     b = Types.CSV()
     with b as w:
         w.write("Hello,world,hi")
     a.set(b)