-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Support pl.Expr.reverse, reverse=True for Polars cummulative expressions
#23164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rapids-bot
merged 26 commits into
NVIDIA:main
from
mroeschke:cudf_polars/enh/cum_reverse
Aug 17, 2026
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
a6a2b84
Support reverse=True for cumulative aggregations via cudf::reverse in…
mroeschke 19954fb
Support pl.Expr.reverse in cudf_polars
mroeschke b1774ec
Merge remote-tracking branch 'upstream/main' into cudf_polars/enh/cum…
mroeschke 16b3b1c
Support reverse in cum_count
mroeschke c8791b4
Merge remote-tracking branch 'upstream/main' into cudf_polars/enh/cum…
mroeschke dfe6f7b
Add comment about GH fq for reverse scan
mroeschke 8b2c30b
Merge remote-tracking branch 'upstream/main' into cudf_polars/enh/rev…
mroeschke 4cebdb8
Merge remote-tracking branch 'upstream/main' into cudf_polars/enh/cum…
mroeschke 7fe21af
Merge branch 'cudf_polars/enh/reverse' into cudf_polars/enh/cum_reverse
mroeschke 863abcd
Directly index for column = in reverse
mroeschke e4b8478
Merge remote-tracking branch 'upstream/main' into cudf_polars/enh/cum…
mroeschke 5002543
Add test_merge_sorted_projection_pd to expected fail list
mroeschke 57c6173
Merge remote-tracking branch 'upstream/main' into cudf_polars/enh/cum…
mroeschke afebe17
Merge remote-tracking branch 'upstream/main' into cudf_polars/enh/cum…
mroeschke ed2a3e2
Remove errant inclusion in __init__
mroeschke b6e33af
Merge remote-tracking branch 'upstream/main' into cudf_polars/enh/cum…
mroeschke 0a4f080
Merge remote-tracking branch 'upstream/main' into cudf_polars/enh/cum…
mroeschke b4daed2
Merge remote-tracking branch 'upstream/main' into cudf_polars/enh/cum…
mroeschke c48f826
Add back reverse
mroeschke 21d28b1
Merge remote-tracking branch 'upstream/main' into cudf_polars/enh/cum…
mroeschke cd4ec4d
Account again for fill_null_with_strategy in rolling
mroeschke 5dc45d4
Merge remote-tracking branch 'upstream/main' into cudf_polars/enh/cum…
mroeschke fdf0ae9
Merge remote-tracking branch 'upstream/main' into cudf_polars/enh/cum…
mroeschke 1d000f5
Merge remote-tracking branch 'upstream/main' into cudf_polars/enh/cum…
mroeschke 60d7cb1
Align typing of stream argument in reverse
mroeschke 04c55a1
Merge remote-tracking branch 'upstream/main' into cudf_polars/enh/cum…
mroeschke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| from __future__ import annotations | ||
|
|
||
| import pytest | ||
|
|
||
| import polars as pl | ||
|
|
||
| from cudf_polars.testing.asserts import assert_gpu_result_equal | ||
|
|
||
|
|
||
| @pytest.mark.parametrize( | ||
| "series", | ||
| [ | ||
| pl.Series([1, 2, 3, 4, 5, 6, 7]), | ||
| pl.Series([1, 2, None, 4, None, 6, 7]), | ||
| pl.Series([1.5, 2.5, float("nan"), -3.0, float("inf"), 0.0, -0.0]), | ||
| pl.Series(["a", "bb", None, "dddd", "e", "ff", "ggg"]), | ||
| pl.Series([1]), | ||
| pl.Series([None, None, None], dtype=pl.Int64), | ||
| pl.Series([], dtype=pl.Int64), | ||
| ], | ||
| ) | ||
| def test_reverse(engine: pl.GPUEngine, series: pl.Series) -> None: | ||
| lf = pl.LazyFrame({"a": series}) | ||
| q = lf.select(pl.col("a").reverse()) | ||
| assert_gpu_result_equal(q, engine=engine) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CUB and thrust definitely support scans over iterators, so I think we should try and instead offer an option to use a reverse iterator in libcudf scans.
Rather than having to copy everything twice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing. Opened #23208 and linked here for a reverse scan in libcudf