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] Adding support for is_null and is_not_null #2962

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7c57700
function and test cases
rgsl888prabhu Oct 3, 2019
4370fc8
change log
rgsl888prabhu Oct 3, 2019
d6e8cbc
review changes
rgsl888prabhu Oct 4, 2019
6ee6722
Merge pull request #20 from rapidsai/branch-0.11
rgsl888prabhu Oct 4, 2019
7641cdc
Merge branch '2143_is_null_and_is_not_null' of https://github.com/rgs…
rgsl888prabhu Oct 4, 2019
2afe671
cython support
rgsl888prabhu Oct 4, 2019
fac1144
review changes and updating isna and notna definition for series
rgsl888prabhu Oct 7, 2019
ee0a03d
Merge pull request #24 from rapidsai/branch-0.11
rgsl888prabhu Oct 7, 2019
2fd920e
Addressing reviews
rgsl888prabhu Oct 8, 2019
01224f3
Merge branch '2143_is_null_and_is_not_null' of https://github.com/rgs…
rgsl888prabhu Oct 8, 2019
612b763
pleasing black
rgsl888prabhu Oct 8, 2019
6563647
Delete global.lock
rgsl888prabhu Oct 8, 2019
7a180ba
Delete purge.lock
rgsl888prabhu Oct 8, 2019
382fd5b
Update CHANGELOG.md
rgsl888prabhu Oct 10, 2019
840547f
Merge branch 'branch-0.11' into 2143_is_null_and_is_not_null
rgsl888prabhu Oct 10, 2019
c71aa4b
Merge branch 'branch-0.11' into 2143_is_null_and_is_not_null
rgsl888prabhu Oct 10, 2019
8423499
removing gpu_isnull gpu_notna notna_mask
rgsl888prabhu Oct 11, 2019
0074137
Merge pull request #32 from rapidsai/branch-0.11
rgsl888prabhu Oct 15, 2019
787d917
merging with branch 0.11
rgsl888prabhu Oct 16, 2019
c6ad279
Merge branch 'branch-0.11' into 2143_is_null_and_is_not_null
kkraus14 Oct 17, 2019
166416f
review changes
rgsl888prabhu Oct 17, 2019
da0f7a9
flake
rgsl888prabhu Oct 17, 2019
d534d60
Merge branch 'branch-0.11' into 2143_is_null_and_is_not_null
rgsl888prabhu Oct 17, 2019
4d05511
Merge branch 'branch-0.11' into 2143_is_null_and_is_not_null
harrism Oct 17, 2019
6d85384
review changes
rgsl888prabhu Oct 18, 2019
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
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

- PR #2962 Adding support for isNULL and isNotNULL
rgsl888prabhu marked this conversation as resolved.
Show resolved Hide resolved


## Improvements

- PR #2904 Move gpu decompressors to cudf::io namespace
Expand Down
16 changes: 8 additions & 8 deletions cpp/src/unary/null_ops.cu
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,29 @@ gdf_column null_op(gdf_column const& input, bool nulls_are_false = true, cudaStr
if (not cudf::is_nullable(input)) {
gdf_scalar value {nulls_are_false, GDF_BOOL8, true};
cudf::fill(&output, value, 0, output.size);
}
else {
} else {
const bit_mask_t* __restrict__ typed_input_valid = reinterpret_cast<bit_mask_t*>(input.valid);
auto exec = rmm::exec_policy(stream)->on(stream);

thrust::transform(exec,
thrust::make_counting_iterator(static_cast<gdf_size_type>(0)),
thrust::transform(exec,
thrust::make_counting_iterator(static_cast<gdf_size_type>(0)),
thrust::make_counting_iterator(static_cast<gdf_size_type>(input.size)),
static_cast<bool*>(output.data),
[=]__device__(auto index){return (nulls_are_false == bit_mask::is_valid(typed_input_valid, index));});
static_cast<bool*>(output.data),
[=]__device__(auto index){
return (nulls_are_false ==
bit_mask::is_valid(typed_input_valid, index));
});
}

return output;
}
}// detail

gdf_column is_null(gdf_column const& input) {

return detail::null_op(input, false, 0);
}

gdf_column is_not_null(gdf_column const& input) {

return detail::null_op(input, true, 0);
}

Expand Down
30 changes: 12 additions & 18 deletions python/cudf/cudf/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1278,15 +1278,12 @@ def to_array(self, fillna=None):
def isnull(self):
"""Identify missing values in a Series.
"""
if not self.has_null_mask:
return Series(
cudautils.zeros(len(self), np.bool_),
name=self.name,
index=self.index,
)

mask = cudautils.isnull_mask(self.data, self.nullmask.mem)
return Series(mask, name=self.name, index=self.index)
result = Series(
libcudf.unaryops.isNULL(self._column),
name=self.name,
index=self.index,
)
rgsl888prabhu marked this conversation as resolved.
Show resolved Hide resolved
return result

def isna(self):
"""Identify missing values in a Series. Alias for isnull.
Expand All @@ -1296,15 +1293,12 @@ def isna(self):
def notna(self):
"""Identify non-missing values in a Series.
"""
if not self.has_null_mask:
return Series(
cudautils.ones(len(self), np.bool_),
name=self.name,
index=self.index,
)

mask = cudautils.notna_mask(self.data, self.nullmask.mem)
return Series(mask, name=self.name, index=self.index)
result = Series(
libcudf.unaryops.isNotNULL(self._column),
name=self.name,
index=self.index,
)
return result

def notnull(self):
"""Identify non-missing values in a Series. Alias for notna.
Expand Down
Empty file.
Empty file.