Skip to content
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

[REVIEW] Fix rolling-window count for null input #6344

Merged
merged 20 commits into from
Oct 13, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8211a68
Fix rolling-window count for null input
mythrocks Sep 29, 2020
4da93f5
Merge remote-tracking branch 'origin/branch-0.16' into window-count-fix
mythrocks Sep 30, 2020
4d3c7b1
Rolling Window count fix: Fixing python tests.
mythrocks Sep 30, 2020
59a36f3
Merge remote-tracking branch 'origin/branch-0.16' into window-count-fix
mythrocks Oct 1, 2020
3b55909
Rolling Window count fix: Using marks for xfail.
mythrocks Oct 1, 2020
90aa2a9
Rolling Window count fix: Fixed formatting
mythrocks Oct 1, 2020
2be5049
Merge remote-tracking branch 'origin/branch-0.16' into window-count-fix
mythrocks Oct 2, 2020
160d9b2
Rolling Window count fix: Review fixes:
mythrocks Oct 2, 2020
1298b0c
Rolling Window count fix: Review fixes:
mythrocks Oct 6, 2020
8697cf1
Merge remote-tracking branch 'origin/branch-0.16' into window-count-fix
mythrocks Oct 6, 2020
9a4b168
Rolling Window count fix: Review fixes:
mythrocks Oct 6, 2020
45003cd
Merge remote-tracking branch 'origin/branch-0.16' into window-count-fix
mythrocks Oct 6, 2020
6264fcc
Merge remote-tracking branch 'origin/branch-0.16' into window-count-fix
mythrocks Oct 7, 2020
c982404
Merge remote-tracking branch 'origin/branch-0.16' into window-count-fix
mythrocks Oct 8, 2020
d901023
Rolling Window count fix: Fixed formatting
mythrocks Oct 8, 2020
f7a8c90
Rolling Window count fix: Fixed process_rolling_window for COUNT_ALL
mythrocks Oct 8, 2020
f34835b
Rolling Window count fix: Use is_valid_no_check().
mythrocks Oct 8, 2020
62709b8
Rolling Window count fix: Python review
mythrocks Oct 12, 2020
7f9b391
Merge remote-tracking branch 'origin/branch-0.16' into window-count-fix
mythrocks Oct 12, 2020
6445c5d
Rolling Window count fix: Python review
mythrocks Oct 12, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions cpp/src/rolling/rolling.cu
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
#include <thrust/binary_search.h>
#include <rmm/device_scalar.hpp>

#include <thrust/detail/execution_policy.h>
#include <thrust/iterator/counting_iterator.h>
#include <memory>

namespace cudf {
Expand Down Expand Up @@ -76,9 +78,10 @@ process_rolling_window(column_device_view input,
if (!has_nulls) {
count = end_index - start_index;
} else {
for (size_type j = start_index; j < end_index; j++) {
if (input.is_valid(j)) { count++; }
}
count = thrust::count_if(thrust::seq,
thrust::make_counting_iterator(start_index),
thrust::make_counting_iterator(end_index),
[&input](auto i) { return input.is_valid(i); });
mythrocks marked this conversation as resolved.
Show resolved Hide resolved
}
output.element<OutputType>(current_index) = count;
}
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/test_rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@pytest.mark.parametrize("agg", ["sum", "min", "max", "mean", "count"])
@pytest.mark.parametrize("nulls", ["none", "one", "some", "all"])
@pytest.mark.parametrize("center", [True, False])
def test_rollling_series_basic(data, index, agg, nulls, center):
def test_rolling_series_basic(data, index, agg, nulls, center):
if PANDAS_GE_110:
kwargs = {"check_freq": False}
else:
Expand Down