MCPcopy Create free account
hub / github.com/apache/arrow / test_recordbatch_pickle

Function test_recordbatch_pickle

python/pyarrow/tests/test_table.py:769–783  ·  view source on GitHub ↗
(pickle_module)

Source from the content-addressed store, hash-verified

767
768
769def test_recordbatch_pickle(pickle_module):
770 data = [
771 pa.array(range(5), type='int8'),
772 pa.array([-10, -5, 0, 5, 10], type='float32')
773 ]
774 fields = [
775 pa.field('ints', pa.int8()),
776 pa.field('floats', pa.float32()),
777 ]
778 schema = pa.schema(fields, metadata={b'foo': b'bar'})
779 batch = pa.record_batch(data, schema=schema)
780
781 result = pickle_module.loads(pickle_module.dumps(batch))
782 assert result.equals(batch)
783 assert result.schema == schema
784
785
786def test_recordbatch_get_field():

Callers

nothing calls this directly

Calls 6

loadsMethod · 0.80
dumpsMethod · 0.80
equalsMethod · 0.80
arrayMethod · 0.45
fieldMethod · 0.45
schemaMethod · 0.45

Tested by

no test coverage detected