-
-
Notifications
You must be signed in to change notification settings - Fork 145
Closed
Labels
ApplyApply, Aggregate, TransformApply, Aggregate, TransformRegressionFunctionality that used to work in a prior pandas versionFunctionality that used to work in a prior pandas version
Description
Describe the bug
A clear and concise description of what the bug is.
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
). - Show the error message received from that type checker while checking your example.
Arguments and return value are both too strict:
months = [1, 2, 3]
pd.Series(months).apply(lambda x: pd.DateOffset(months=x))
returns
error: Argument 1 to "apply" of "Series" has incompatible type "Callable[[Any], DateOffset]"; expected "Callable[..., Union[str, bytes, date, timedelta, complex, Sequence[Any], Mapping[Any, Any]]]" [arg-type]
error: Incompatible return value type (got "DateOffset", expected "Union[str, bytes, date, timedelta, complex, Sequence[Any], Mapping[Any, Any]]") [return-value]
Please complete the following information:
- OS: [e.g. Windows, Linux, MacOS] macOS
- OS Version [e.g. 22] Ventura 13.01
- python version 3.10.5
- version of type checker mypy 0.990
- version of installed
pandas-stubs
pandas_stubs-1.5.2.221124
Additional context
Add any other context about the problem here.
This was caused by #401
Metadata
Metadata
Assignees
Labels
ApplyApply, Aggregate, TransformApply, Aggregate, TransformRegressionFunctionality that used to work in a prior pandas versionFunctionality that used to work in a prior pandas version