-
Notifications
You must be signed in to change notification settings - Fork 948
Support rolling aggregations in in-memory cudf-polars execution #18681
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
Changes from all commits
b49509e
9a4d733
fa92575
1d18e70
53495ff
ea07035
dcdde51
114bd35
a71147c
000ef19
c239211
d809225
ef46f48
591f0ff
8a19e1b
13277bd
5411f39
8bacc3b
78678ca
e17572c
633d5aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -177,6 +177,44 @@ def sorted_like(self, like: Column, /) -> Self: | |
null_order=like.null_order, | ||
) | ||
|
||
def check_sorted( | ||
self, | ||
*, | ||
order: plc.types.Order, | ||
null_order: plc.types.NullOrder, | ||
) -> bool: | ||
""" | ||
Check if the column is sorted. | ||
|
||
Parameters | ||
---------- | ||
order | ||
The requested sort order. | ||
null_order | ||
Where nulls sort to. | ||
|
||
Returns | ||
------- | ||
True if the column is sorted, false otherwise. | ||
|
||
Notes | ||
----- | ||
If the sortedness flag is not set, this launches a kernel to | ||
check sortedness. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably worth noting here, or somewhere, that this might mutate I was initially a little worried about this, but I see now that it fits the description of this class (where the data is immutable, and these sortedness attributes are essentially caches on properties that data has). |
||
""" | ||
if self.obj.size() <= 1 or self.obj.size() == self.obj.null_count(): | ||
return True | ||
if self.is_sorted == plc.types.Sorted.YES: | ||
return self.order == order and ( | ||
self.obj.null_count() == 0 or self.null_order == null_order | ||
TomAugspurger marked this conversation as resolved.
Show resolved
Hide resolved
|
||
) | ||
if plc.sorting.is_sorted(plc.Table([self.obj]), [order], [null_order]): | ||
self.sorted = plc.types.Sorted.YES | ||
self.order = order | ||
self.null_order = null_order | ||
return True | ||
return False | ||
|
||
def astype(self, dtype: plc.DataType) -> Column: | ||
""" | ||
Cast the column to as the requested dtype. | ||
|
Uh oh!
There was an error while loading. Please reload this page.