()
| 521 | |
| 522 | |
| 523 | def test_chunked_array_c_stream_interface(): |
| 524 | class ChunkedArrayWrapper: |
| 525 | def __init__(self, chunked): |
| 526 | self.chunked = chunked |
| 527 | |
| 528 | def __arrow_c_stream__(self, requested_schema=None): |
| 529 | return self.chunked.__arrow_c_stream__(requested_schema) |
| 530 | |
| 531 | data = pa.chunked_array([[1, 2, 3], [4, None, 6]]) |
| 532 | wrapper = ChunkedArrayWrapper(data) |
| 533 | |
| 534 | # Can roundtrip through the wrapper. |
| 535 | result = pa.chunked_array(wrapper) |
| 536 | assert result == data |
| 537 | |
| 538 | # Can also import with a type that implementer can cast to. |
| 539 | result = pa.chunked_array(wrapper, type=pa.int16()) |
| 540 | assert result == data.cast(pa.int16()) |
| 541 | |
| 542 | |
| 543 | class BatchWrapper: |
nothing calls this directly
no test coverage detected