Skip to content

Commit

Permalink
FIX-#5972: compute correct dtype for `Series.str.find/index/rfind/rin…
Browse files Browse the repository at this point in the history
…dex` (#6426)

Signed-off-by: Anatoly Myachev <[email protected]>
  • Loading branch information
anmyachev authored Aug 1, 2023
1 parent 0e0a2e6 commit 5af3318
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 4 additions & 4 deletions modin/core/storage_formats/pandas/query_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1804,10 +1804,10 @@ def isin_func(df, values):
str_contains = Map.register(_str_map("contains"), dtypes=np.bool_)
str_count = Map.register(_str_map("count"), dtypes=int)
str_endswith = Map.register(_str_map("endswith"), dtypes=np.bool_)
str_find = Map.register(_str_map("find"), dtypes="copy")
str_find = Map.register(_str_map("find"), dtypes=np.int64)
str_findall = Map.register(_str_map("findall"), dtypes="copy")
str_get = Map.register(_str_map("get"), dtypes="copy")
str_index = Map.register(_str_map("index"), dtypes="copy")
str_index = Map.register(_str_map("index"), dtypes=np.int64)
str_isalnum = Map.register(_str_map("isalnum"), dtypes=np.bool_)
str_isalpha = Map.register(_str_map("isalpha"), dtypes=np.bool_)
str_isdecimal = Map.register(_str_map("isdecimal"), dtypes=np.bool_)
Expand Down Expand Up @@ -1847,8 +1847,8 @@ def str_extract(self, pat, flags, expand):
return qc

str_replace = Map.register(_str_map("replace"), dtypes="copy", shape_hint="column")
str_rfind = Map.register(_str_map("rfind"), dtypes="copy", shape_hint="column")
str_rindex = Map.register(_str_map("rindex"), dtypes="copy", shape_hint="column")
str_rfind = Map.register(_str_map("rfind"), dtypes=np.int64, shape_hint="column")
str_rindex = Map.register(_str_map("rindex"), dtypes=np.int64, shape_hint="column")
str_rjust = Map.register(_str_map("rjust"), dtypes="copy", shape_hint="column")
_str_rpartition = Map.register(
_str_map("rpartition"), dtypes="copy", shape_hint="column"
Expand Down
8 changes: 0 additions & 8 deletions modin/pandas/test/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -4338,8 +4338,6 @@ def test_str_find(data, sub, start, end):
modin_series,
pandas_series,
lambda series: series.str.find(sub, start=start, end=end),
# https://github.com/modin-project/modin/issues/5972
comparator_kwargs={"check_dtypes": False},
)


Expand All @@ -4353,8 +4351,6 @@ def test_str_rfind(data, sub, start, end):
modin_series,
pandas_series,
lambda series: series.str.rfind(sub, start=start, end=end),
# https://github.com/modin-project/modin/issues/5972
comparator_kwargs={"check_dtypes": False},
)


Expand All @@ -4368,8 +4364,6 @@ def test_str_index(data, sub, start, end):
modin_series,
pandas_series,
lambda series: series.str.index(sub, start=start, end=end),
# https://github.com/modin-project/modin/issues/5972
comparator_kwargs={"check_dtypes": False},
)


Expand All @@ -4383,8 +4377,6 @@ def test_str_rindex(data, sub, start, end):
modin_series,
pandas_series,
lambda series: series.str.rindex(sub, start=start, end=end),
# https://github.com/modin-project/modin/issues/5972
comparator_kwargs={"check_dtypes": False},
)


Expand Down

0 comments on commit 5af3318

Please sign in to comment.