(ids_and_cols)
| 241 | reduced = tmp.reduce(ids_and_cols=pw.reducers.sorted_tuple(tmp.id_and_cols)) |
| 242 | |
| 243 | def fun_wrapped(ids_and_cols): |
| 244 | ids, *cols = zip(*ids_and_cols) |
| 245 | res = fun(*cols) |
| 246 | return tuple(zip(ids, *res)) |
| 247 | |
| 248 | applied = reduced.select(ids_and_res=pw.apply(fun_wrapped, reduced.ids_and_cols)) |
| 249 | flatted = applied.flatten(pw.this.ids_and_res) |