()
| 324 | |
| 325 | |
| 326 | def test_group_by_ordering(): |
| 327 | # GH-36709 - preserve ordering in groupby by setting use_threads=False |
| 328 | table1 = pa.table({'a': [1, 2, 3, 4], 'b': ['a'] * 4}) |
| 329 | table2 = pa.table({'a': [1, 2, 3, 4], 'b': ['b'] * 4}) |
| 330 | table = pa.concat_tables([table1, table2]) |
| 331 | |
| 332 | for _ in range(50): |
| 333 | # 50 seems to consistently cause errors when order is not preserved. |
| 334 | # If the order problem is reintroduced this test will become flaky |
| 335 | # which is still a signal that the order is not preserved. |
| 336 | result = table.group_by("b", use_threads=False).aggregate([]) |
| 337 | assert result["b"] == pa.chunked_array([["a"], ["b"]]) |
nothing calls this directly
no test coverage detected