You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug .str.startswith appears to be taking inputs that are not str and tuple too. Atleast in pandas compatibility mode we need to disable allowing other input types.
Steps/Code to reproduce bug
In [1]: importcudfIn [2]: s=cudf.Series(["foo", "bar"])
In [3]: s.str.startswith(s)
Out[3]:
0True1Truedtype: boolIn [4]: s.to_pandas().str.startswith(s.to_pandas())
---------------------------------------------------------------------------TypeErrorTraceback (mostrecentcalllast)
CellIn[4], line1---->1s.to_pandas().str.startswith(s.to_pandas())
File/datasets/pgali/envs/cudfdev/lib/python3.12/site-packages/pandas/core/strings/accessor.py:137, inforbid_nonstring_types.<locals>._forbid_nonstring_types.<locals>.wrapper(self, *args, **kwargs)
132msg= (
133f"Cannot use .str.{func_name} with values of "134f"inferred dtype '{self._inferred_dtype}'."135 )
136raiseTypeError(msg)
-->137returnfunc(self, *args, **kwargs)
File/datasets/pgali/envs/cudfdev/lib/python3.12/site-packages/pandas/core/strings/accessor.py:2482, inStringMethods.startswith(self, pat, na)
2480ifnotisinstance(pat, (str, tuple)):
2481msg=f"expected a string or tuple, not {type(pat).__name__}"->2482raiseTypeError(msg)
2483result=self._data.array._str_startswith(pat, na=na)
2484returnself._wrap_result(result, returns_string=False)
TypeError: expectedastringortuple, notSeries
The text was updated successfully, but these errors were encountered:
Describe the bug
.str.startswith
appears to be taking inputs that are notstr
andtuple
too. Atleast in pandas compatibility mode we need to disable allowing other input types.Steps/Code to reproduce bug
The text was updated successfully, but these errors were encountered: