Skip to content

Commit

Permalink
allow repeats=None error
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahyurick committed Aug 2, 2021
1 parent a7483c0 commit 37ceaf2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
8 changes: 1 addition & 7 deletions python/cudf/cudf/core/column/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,18 +791,12 @@ def repeat(self, repeats: Union[int, Sequence],) -> SeriesOrIndex:
2 ccc
dtype: object
"""
none_flag = False
if repeats is None:
none_flag = True
repeats = [None] * len(self._column)

if can_convert_to_column(repeats):
result = self._return_or_inplace(
return self._return_or_inplace(
libstrings.repeat_sequence(
self._column, column.as_column(repeats, dtype="int"),
),
)
return result.astype("float64") if none_flag else result

return self._return_or_inplace(
libstrings.repeat_scalar(self._column, repeats)
Expand Down
1 change: 0 additions & 1 deletion python/cudf/cudf/tests/test_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,6 @@ def test_string_contains(ps_gs, pat, regex, flags, flags_raise, na, na_raise):
2,
0,
-3,
None,
[5, 4, 3, 2, 6],
[5, None, 3, 2, 6],
[0, 0, 0, 0, 0],
Expand Down

0 comments on commit 37ceaf2

Please sign in to comment.