Commits


Robert Nishihara authored and Wes McKinney committed 28e06d870b6
ARROW-1194: [Python] Expose MockOutputStream in pyarrow. This allows you to get the size of a record batch and schema through pyarrow by writing to a mock output stream. You can then use the resulting size to allocate an appropriately sized buffer to actually write to. Example usage. ```python import pyarrow as pa import pandas as pd val = pd.DataFrame({'a': [1, 2, 3]}) record_batch = pa.RecordBatch.from_pandas(val) # Get the size of the record batch and schema sink = pa.MockOutputStream() stream_writer = pa.RecordBatchStreamWriter(sink, record_batch.schema) stream_writer.write_batch(record_batch) size = sink.size() ``` Author: Robert Nishihara <robertnishihara@gmail.com> Closes #830 from robertnishihara/mockoutputstream and squashes the following commits: 4e15cd9 [Robert Nishihara] Expose MockOutputStream to Python.