Closed cmp0xff closed 1 week ago
Thanks for the report. The declaration of match()
in core/strings.pyi
is incorrect. But to fix it, the StringMethods
class will need an additional argument to pass in the expected result of match()
, similar to what is done with str.split()
.
PR with tests welcome
Describe the bug
df.columns.str.match(reg_ex_pattern)
actually givesnpt.NDArray[np.bool_]
, but mypy thinks it'spd.Index[str]
To Reproduce
Provide a minimal runnable
pandas
example that is not properly checked by the stubs.Indicate which type checker you are using (
mypy
orpyright
).I am using
mypy
.Show the error message received from that type checker while checking your example.
Please complete the following information:
pandas-stubs
Additional context
Nothing