github.com/ydb-platform/ydb-go-sdk/v3@v3.89.2/tests/integration/testdata/make_test_arrow.py (about)

     1  #! /usr/bin/env python3
     2  import pyarrow
     3  
     4  schema = pyarrow.schema([("id", pyarrow.int64()), ("val", pyarrow.utf8())])
     5  
     6  with open("bulk_upsert_test_schema.arrow", "bw") as schema_file:
     7      schema_file.write(schema.serialize().to_pybytes())
     8  
     9  data = [
    10      pyarrow.array([123, 234]),
    11      pyarrow.array(["data1", "data2"]),
    12  ]
    13  
    14  batch = pyarrow.record_batch(data, schema=schema)
    15  
    16  with open("bulk_upsert_test_data.arrow", "bw") as data_file:
    17      data_file.write(batch.serialize())