cudf-polars does not currently support grouped reductions where the selected value is ordered by another expression, such as pl.col("x").sort_by("t").first() inside group_by(...).agg(...).
This issue should cover the common ordered first/last grouped-reduction variants:
Example:
def test_group_by_sort_by_first_last(engine: GPUEngine) -> None:
"""``group_by(...).agg(col.sort_by(...).first/last())``.
Status
------
- In-memory NOT supported
- Streaming NOT supported
"""
lf = pl.LazyFrame(
{
"g": ["A", "A", "B", "B"],
"t": [2, 1, 2, 1],
"x": [10, 20, 30, 40],
}
)
q = lf.group_by("g").agg(
first_x=pl.col("x").sort_by("t").first(),
last_x=pl.col("x").sort_by("t").last(),
)
assert_gpu_result_equal(q, engine=engine)
cudf-polars does not currently support grouped reductions where the selected value is ordered by another expression, such as
pl.col("x").sort_by("t").first()insidegroup_by(...).agg(...).This issue should cover the common ordered first/last grouped-reduction variants:
sort_by(...).first()sort_by(...).last()sort_byExample: