From 37ceaf28201f487a9ac6f40ad994db4c7d32cbd5 Mon Sep 17 00:00:00 2001 From: Sarah Yurick <53962159+sarahyurick@users.noreply.github.com> Date: Mon, 2 Aug 2021 16:57:20 -0400 Subject: [PATCH] allow repeats=None error --- python/cudf/cudf/core/column/string.py | 8 +------- python/cudf/cudf/tests/test_string.py | 1 - 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/python/cudf/cudf/core/column/string.py b/python/cudf/cudf/core/column/string.py index 27827a4c6b4..92c32131ef9 100644 --- a/python/cudf/cudf/core/column/string.py +++ b/python/cudf/cudf/core/column/string.py @@ -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) diff --git a/python/cudf/cudf/tests/test_string.py b/python/cudf/cudf/tests/test_string.py index 66df338df25..9a7ef4e2099 100644 --- a/python/cudf/cudf/tests/test_string.py +++ b/python/cudf/cudf/tests/test_string.py @@ -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],