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

Function test_recordbatch_pickle

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

Source from the content-addressed store, hash-verified

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