| 3118 | |
| 3119 | @pytest.mark.acero |
| 3120 | def test_table_group_by_first(): |
| 3121 | # "first" is an ordered aggregation -> requires to specify use_threads=False |
| 3122 | table1 = pa.table({'a': [1, 2, 3, 4], 'b': ['a', 'b'] * 2}) |
| 3123 | table2 = pa.table({'a': [1, 2, 3, 4], 'b': ['b', 'a'] * 2}) |
| 3124 | table = pa.concat_tables([table1, table2]) |
| 3125 | |
| 3126 | with pytest.raises(NotImplementedError): |
| 3127 | table.group_by("b").aggregate([("a", "first")]) |
| 3128 | |
| 3129 | result = table.group_by("b", use_threads=False).aggregate([("a", "first")]) |
| 3130 | expected = pa.table({"b": ["a", "b"], "a_first": [1, 2]}) |
| 3131 | assert result.equals(expected) |
| 3132 | |
| 3133 | |
| 3134 | @pytest.mark.acero |