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

Function test_schema_batch_serialize_methods

python/pyarrow/tests/test_ipc.py:1133–1145  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1131
1132@pytest.mark.pandas
1133def test_schema_batch_serialize_methods():
1134 nrows = 5
1135 df = pd.DataFrame({
1136 'one': np.random.randn(nrows),
1137 'two': ['foo', np.nan, 'bar', 'bazbaz', 'qux']})
1138 batch = pa.RecordBatch.from_pandas(df)
1139
1140 s_schema = batch.schema.serialize()
1141 s_batch = batch.serialize()
1142
1143 recons_schema = pa.ipc.read_schema(s_schema)
1144 recons_batch = pa.ipc.read_record_batch(s_batch, recons_schema)
1145 assert recons_batch.equals(batch)
1146
1147
1148def test_schema_serialization_with_metadata():

Callers

nothing calls this directly

Calls 3

equalsMethod · 0.80
read_schemaMethod · 0.45
read_record_batchMethod · 0.45

Tested by

no test coverage detected