()
| 500 | |
| 501 | |
| 502 | def test_chunked_array_c_array_interface(): |
| 503 | class ArrayWrapper: |
| 504 | def __init__(self, array): |
| 505 | self.array = array |
| 506 | |
| 507 | def __arrow_c_array__(self, requested_schema=None): |
| 508 | return self.array.__arrow_c_array__(requested_schema) |
| 509 | |
| 510 | data = pa.array([1, 2, 3], pa.int64()) |
| 511 | chunked = pa.chunked_array([data]) |
| 512 | wrapper = ArrayWrapper(data) |
| 513 | |
| 514 | # Can roundtrip through the wrapper. |
| 515 | result = pa.chunked_array(wrapper) |
| 516 | assert result == chunked |
| 517 | |
| 518 | # Can also import with a type that implementer can cast to. |
| 519 | result = pa.chunked_array(wrapper, type=pa.int16()) |
| 520 | assert result == chunked.cast(pa.int16()) |
| 521 | |
| 522 | |
| 523 | def test_chunked_array_c_stream_interface(): |
nothing calls this directly
no test coverage detected