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