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

Class StreamWrapper

python/pyarrow/tests/test_table.py:622–629  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

Calls

no outgoing calls

Tested by 1