()
| 4108 | |
| 4109 | |
| 4110 | def test_array_sort(): |
| 4111 | arr = pa.array([5, 7, 35], type=pa.int64()) |
| 4112 | sorted_arr = arr.sort("descending") |
| 4113 | assert sorted_arr.to_pylist() == [35, 7, 5] |
| 4114 | |
| 4115 | arr = pa.chunked_array([[1, 2, 3], [4, 5, 6]]) |
| 4116 | sorted_arr = arr.sort("descending") |
| 4117 | assert sorted_arr.to_pylist() == [6, 5, 4, 3, 2, 1] |
| 4118 | |
| 4119 | arr = pa.array([5, 7, 35, None], type=pa.int64()) |
| 4120 | sorted_arr = arr.sort("descending", null_placement="at_end") |
| 4121 | assert sorted_arr.to_pylist() == [35, 7, 5, None] |
| 4122 | sorted_arr = arr.sort("descending", null_placement="at_start") |
| 4123 | assert sorted_arr.to_pylist() == [None, 35, 7, 5] |
| 4124 | |
| 4125 | |
| 4126 | def test_struct_array_sort(): |
nothing calls this directly
no test coverage detected