@@ -100,6 +100,7 @@ class SeriesGroupBy(GroupBy):
100
100
def nlargest (self , n : int = ..., keep : str = ...) -> Series [S1 ]: ...
101
101
def nsmallest (self , n : int = ..., keep : str = ...) -> Series [S1 ]: ...
102
102
def nth (self , n : int | Sequence [int ], dropna : str | None = ...) -> Series [S1 ]: ...
103
+ def sum (self , ** kwargs ) -> Series [S1 ]: ...
103
104
104
105
class _DataFrameGroupByScalar (DataFrameGroupBy ):
105
106
def __iter__ (self ) -> Iterator [tuple [Scalar , DataFrame ]]: ...
@@ -110,17 +111,19 @@ class _DataFrameGroupByNonScalar(DataFrameGroupBy):
110
111
class DataFrameGroupBy (GroupBy ):
111
112
def any (self , skipna : bool = ...) -> DataFrame : ...
112
113
def all (self , skipna : bool = ...) -> DataFrame : ...
113
- # mypy sees the two overloads as overlapping
114
+ # mypy and pyright see these overloads as overlapping
114
115
@overload
115
116
def apply ( # type: ignore[misc]
116
- self , func : Callable [[DataFrame ], Series | Scalar ], * args , ** kwargs
117
+ self , func : Callable [[DataFrame ], Scalar | list | dict ], * args , ** kwargs
117
118
) -> Series : ...
118
119
@overload
119
120
def apply ( # type: ignore[misc]
120
- self , func : Callable [[Iterable ], Series | Scalar ], * args , ** kwargs
121
+ self , func : Callable [[DataFrame ], Series | DataFrame ], * args , ** kwargs
121
122
) -> DataFrame : ...
122
123
@overload
123
- def apply (self , func : Callable , * args , ** kwargs ) -> DataFrame | Series : ...
124
+ def apply ( # type: ignore[misc]
125
+ self , func : Callable [[Iterable ], float ], * args , ** kwargs
126
+ ) -> DataFrame : ...
124
127
@overload
125
128
def aggregate (self , arg : str , * args , ** kwargs ) -> DataFrame : ...
126
129
@overload
0 commit comments