Skip to content

Commit

Permalink
Drop kwargs from Series.count (#14106)
Browse files Browse the repository at this point in the history
Fixes: #14089 
This PR drops `kwargs` from `Series.count` method signature.

Authors:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

Approvers:
  - Matthew Roeschke (https://github.com/mroeschke)
  - Benjamin Zaitlen (https://github.com/quasiben)

URL: #14106
  • Loading branch information
galipremsagar authored Sep 18, 2023
1 parent 4ca568e commit 5935ef3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/cudf/cudf/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -2549,7 +2549,7 @@ def apply(self, func, convert_dtype=True, args=(), **kwargs):
# Stats
#
@_cudf_nvtx_annotate
def count(self, level=None, **kwargs):
def count(self, level=None):
"""
Return number of non-NA/null observations in the Series
Expand Down
6 changes: 6 additions & 0 deletions python/cudf/cudf/tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -2311,3 +2311,9 @@ def test_series_round_builtin(data, digits):
actual = round(gs, digits)

assert_eq(expected, actual)


def test_series_count_invalid_param():
s = cudf.Series([])
with pytest.raises(TypeError):
s.count(skipna=True)
2 changes: 1 addition & 1 deletion python/dask_cudf/dask_cudf/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def _naive_var(ddf, meta, skipna, ddof, split_every, out):
def _parallel_var(ddf, meta, skipna, split_every, out):
def _local_var(x, skipna):
if skipna:
n = x.count(skipna=skipna)
n = x.count()
avg = x.mean(skipna=skipna)
else:
# Not skipping nulls, so might as well
Expand Down

0 comments on commit 5935ef3

Please sign in to comment.