Python -> Rust -> Python
()
| 671 | |
| 672 | |
| 673 | def test_table_roundtrip(): |
| 674 | """ |
| 675 | Python -> Rust -> Python |
| 676 | """ |
| 677 | schema = pa.schema([pa.field(name='ints', type=pa.list_(pa.int32()), metadata={b'key1': b'value1'})], metadata={b'key1': b'value1'}) |
| 678 | batches = [ |
| 679 | pa.record_batch([[[1], [2, 42]]], schema), |
| 680 | pa.record_batch([[None, [], [5, 6]]], schema), |
| 681 | ] |
| 682 | table = pa.Table.from_batches(batches, schema=schema) |
| 683 | new_table = rust.round_trip_table(table) |
| 684 | |
| 685 | assert table == new_table |
| 686 | assert table.schema == new_table.schema |
| 687 | assert table.schema.metadata == new_table.schema.metadata |
| 688 | assert len(table.to_batches()) == len(new_table.to_batches()) |
| 689 | |
| 690 | |
| 691 | def test_table_from_batches(): |
nothing calls this directly
no test coverage detected