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

Class StreamWrapper

python/pyarrow/tests/test_table.py:621–628  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

619
620def test_table_c_stream_interface():
621 class StreamWrapper:
622 def __init__(self, batches):
623 self.batches = batches
624
625 def __arrow_c_stream__(self, requested_schema=None):
626 reader = pa.RecordBatchReader.from_batches(
627 self.batches[0].schema, self.batches)
628 return reader.__arrow_c_stream__(requested_schema)
629
630 data = [
631 pa.record_batch([pa.array([1, 2, 3], type=pa.int64())], names=['a']),

Callers 1

Calls

no outgoing calls

Tested by 1