()
| 729 | |
| 730 | |
| 731 | def make_table(): |
| 732 | a0 = pa.array([0, 1, 42, None], type=pa.int16()) |
| 733 | a1 = pa.array([[0, 1], [2], [], None], type=pa.list_(pa.int32())) |
| 734 | a2 = pa.array([("ab", True), ("cde", False), (None, None), None], |
| 735 | type=pa.struct([("strs", pa.utf8()), |
| 736 | ("bools", pa.bool_())])) |
| 737 | # Dictionaries are validated on the IPC read path, but that can produce |
| 738 | # issues for GPU-located dictionaries. Check that they work fine. |
| 739 | a3 = pa.DictionaryArray.from_arrays( |
| 740 | indices=[0, 1, 1, None], |
| 741 | dictionary=pa.array(['foo', 'bar'])) |
| 742 | a4 = pa.DictionaryArray.from_arrays( |
| 743 | indices=[2, 1, 2, None], |
| 744 | dictionary=a1) |
| 745 | a5 = pa.DictionaryArray.from_arrays( |
| 746 | indices=[2, 1, 0, None], |
| 747 | dictionary=a2) |
| 748 | |
| 749 | arrays = [a0, a1, a2, a3, a4, a5] |
| 750 | schema = pa.schema([ |
| 751 | (f'f{i}', arr.type) |
| 752 | for i, arr in enumerate(arrays) |
| 753 | ]) |
| 754 | batch = pa.record_batch(arrays, schema=schema) |
| 755 | table = pa.Table.from_batches([batch]) |
| 756 | return table |
| 757 | |
| 758 | |
| 759 | def make_table_cuda(): |
no test coverage detected