Skip to content

Commit d13dfe2

Browse files
committed
use paramspec on args, kwargs
1 parent 4081c27 commit d13dfe2

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

pandas-stubs/core/groupby/generic.pyi

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,18 @@ class SeriesGroupBy(GroupBy[Series[S2]], Generic[S2, ByT]):
209209

210210
_TT = TypeVar("_TT", bound=Literal[True, False])
211211

212-
class DFCallable1(Protocol):
213-
def __call__(self, df: DataFrame, /, *args, **kwargs) -> Scalar | list | dict: ...
212+
class DFCallable1(Protocol[P]): # ty: ignore[invalid-argument-type]
213+
def __call__(
214+
self, df: DataFrame, /, *args: P.args, **kwargs: P.kwargs
215+
) -> Scalar | list | dict: ...
214216

215-
class DFCallable2(Protocol):
216-
def __call__(self, df: DataFrame, /, *args, **kwargs) -> DataFrame | Series: ...
217+
class DFCallable2(Protocol[P]): # ty: ignore[invalid-argument-type]
218+
def __call__(
219+
self, df: DataFrame, /, *args: P.args, **kwargs: P.kwargs
220+
) -> DataFrame | Series: ...
217221

218-
class DFCallable3(Protocol):
219-
def __call__(self, df: Iterable, /, *args, **kwargs) -> float: ...
222+
class DFCallable3(Protocol[P]): # ty: ignore[invalid-argument-type]
223+
def __call__(self, df: Iterable, /, *args: P.args, **kwargs: P.kwargs) -> float: ...
220224

221225
class DataFrameGroupBy(GroupBy[DataFrame], Generic[ByT, _TT]):
222226
# error: Overload 3 for "apply" will never be used because its parameters overlap overload 1

0 commit comments

Comments
 (0)