Python -> Rust -> Python
()
| 637 | |
| 638 | @pytest.mark.skipif(PYARROW_PRE_14, reason="requires pyarrow 14") |
| 639 | def test_table_pycapsule(): |
| 640 | """ |
| 641 | Python -> Rust -> Python |
| 642 | """ |
| 643 | schema = pa.schema([pa.field(name='ints', type=pa.list_(pa.int32()), metadata={b'key1': b'value1'})], metadata={b'key1': b'value1'}) |
| 644 | batches = [ |
| 645 | pa.record_batch([[[1], [2, 42]]], schema), |
| 646 | pa.record_batch([[None, [], [5, 6]]], schema), |
| 647 | ] |
| 648 | table = pa.Table.from_batches(batches) |
| 649 | wrapped = StreamWrapper(table) |
| 650 | b = rust.round_trip_record_batch_reader(wrapped) |
| 651 | new_table = b.read_all() |
| 652 | |
| 653 | assert table == new_table |
| 654 | assert table.schema == new_table.schema |
| 655 | assert table.schema.metadata == new_table.schema.metadata |
| 656 | assert len(table.to_batches()) == len(new_table.to_batches()) |
| 657 | |
| 658 | |
| 659 | def test_table_empty(): |
nothing calls this directly
no test coverage detected