Skip to content

Commit 4fb9c61

Browse files
committed
refactor: #1168 *args: Any and **kwargs: Any
1 parent 6ce988b commit 4fb9c61

32 files changed

+228
-175
lines changed

pandas-stubs/_libs/json.pyi

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
def decode(*args, **kwargs): ...
2-
def dumps(*args, **kwargs): ...
3-
def encode(*args, **kwargs): ...
4-
def loads(*args, **kwargs): ...
1+
from typing import Any
2+
3+
def decode(*args: Any, **kwargs: Any): ...
4+
def dumps(*args: Any, **kwargs: Any): ...
5+
def encode(*args: Any, **kwargs: Any): ...
6+
def loads(*args: Any, **kwargs: Any): ...
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
from typing import Any
2+
13
class DateParseError(ValueError):
2-
def __init__(self, *args, **kwargs) -> None: ...
4+
def __init__(self, *args: Any, **kwargs: Any) -> None: ...

pandas-stubs/_testing/__init__.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ from collections.abc import (
55
)
66
from contextlib import contextmanager
77
from typing import (
8+
Any,
89
Literal,
910
overload,
1011
)
@@ -38,7 +39,7 @@ def assert_almost_equal(
3839
check_dtype: bool | Literal["equiv"] = "equiv",
3940
rtol: float = 1e-5,
4041
atol: float = 1e-8,
41-
**kwargs,
42+
**kwargs: Any,
4243
) -> None: ...
4344
def assert_dict_equal(left: dict, right: dict, compare_keys: bool = True) -> None: ...
4445
def assert_index_equal(
@@ -172,7 +173,7 @@ def assert_frame_equal(
172173
atol: float = 1e-8,
173174
obj: str = "DataFrame",
174175
) -> None: ...
175-
def assert_equal(left, right, **kwargs) -> None: ...
176+
def assert_equal(left, right, **kwargs: Any) -> None: ...
176177
def assert_sp_array_equal(left: SparseArray, right: SparseArray) -> None: ...
177178
def assert_contains_all(iterable: Iterable[T], dic: Container[T]) -> None: ...
178179
def assert_copy(iter1: Iterable[T], iter2: Iterable[T], **eql_kwargs) -> None: ...

pandas-stubs/core/arrays/base.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class ExtensionArray:
4646
def astype(self, dtype, copy: bool = True): ...
4747
def isna(self) -> ArrayLike: ...
4848
def argsort(
49-
self, *, ascending: bool = ..., kind: str = ..., **kwargs
49+
self, *, ascending: bool = ..., kind: str = ..., **kwargs: Any
5050
) -> np_1darray: ...
5151
def fillna(self, value=..., method=None, limit=None): ...
5252
def dropna(self): ...
@@ -67,14 +67,14 @@ class ExtensionArray:
6767
def ravel(self, order="C") -> Self: ...
6868
def tolist(self) -> list: ...
6969
def _reduce(
70-
self, name: str, *, skipna: bool = ..., keepdims: bool = ..., **kwargs
70+
self, name: str, *, skipna: bool = ..., keepdims: bool = ..., **kwargs: Any
7171
) -> object: ...
7272
def _accumulate(
7373
self,
7474
name: Literal["cummin", "cummax", "cumsum", "cumprod"],
7575
*,
7676
skipna: bool = True,
77-
**kwargs,
77+
**kwargs: Any,
7878
) -> Self: ...
7979

8080
class ExtensionOpsMixin:

pandas-stubs/core/arrays/boolean.pyi

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from typing import Any
2+
13
import numpy as np
24
from pandas.core.arrays.masked import BaseMaskedArray as BaseMaskedArray
35

@@ -18,8 +20,8 @@ class BooleanArray(BaseMaskedArray):
1820
) -> None: ...
1921
@property
2022
def dtype(self): ...
21-
def __array_ufunc__(self, ufunc, method, *inputs, **kwargs): ...
23+
def __array_ufunc__(self, ufunc, method, *inputs, **kwargs: Any): ...
2224
def __setitem__(self, key, value) -> None: ...
2325
def astype(self, dtype, copy: bool = True): ...
24-
def any(self, *, skipna: bool = ..., **kwargs): ...
25-
def all(self, *, skipna: bool = ..., **kwargs): ...
26+
def any(self, *, skipna: bool = ..., **kwargs: Any): ...
27+
def all(self, *, skipna: bool = ..., **kwargs: Any): ...

pandas-stubs/core/arrays/categorical.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class Categorical(ExtensionArray):
9090
def shape(self): ...
9191
def shift(self, periods=1, fill_value=...): ...
9292
def __array__(self, dtype=...) -> np_1darray: ...
93-
def __array_ufunc__(self, ufunc, method, *inputs, **kwargs): ...
93+
def __array_ufunc__(self, ufunc, method, *inputs, **kwargs: Any): ...
9494
@property
9595
def T(self): ...
9696
@property
@@ -103,7 +103,7 @@ class Categorical(ExtensionArray):
103103
def dropna(self): ...
104104
def value_counts(self, dropna: bool = True): ...
105105
def check_for_ordered(self, op) -> None: ...
106-
def argsort(self, *, ascending: bool = ..., kind: str = ..., **kwargs): ...
106+
def argsort(self, *, ascending: bool = ..., kind: str = ..., **kwargs: Any): ...
107107
def sort_values(
108108
self, *, inplace: bool = ..., ascending: bool = ..., na_position: str = ...
109109
): ...

pandas-stubs/core/arrays/datetimelike.pyi

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from collections.abc import Sequence
22
from typing import (
3+
Any,
34
TypeAlias,
45
overload,
56
)
@@ -58,8 +59,8 @@ class DatetimeLikeArrayMixin(ExtensionOpsMixin, ExtensionArray):
5859
def ndim(self) -> int: ...
5960
@property
6061
def shape(self): ...
61-
def reshape(self, *args, **kwargs): ...
62-
def ravel(self, *args, **kwargs): ... # pyrefly: ignore
62+
def reshape(self, *args: Any, **kwargs: Any): ...
63+
def ravel(self, *args: Any, **kwargs: Any): ... # pyrefly: ignore
6364
def __iter__(self): ...
6465
@property
6566
def asi8(self) -> np.ndarray: ...
@@ -84,7 +85,7 @@ class DatetimeLikeArrayMixin(ExtensionOpsMixin, ExtensionArray):
8485
def unique(self): ...
8586
def copy(self): ...
8687
def shift(self, periods: int = 1, fill_value=..., axis: int = ...): ...
87-
def repeat(self, repeats, *args, **kwargs): ... # pyrefly: ignore
88+
def repeat(self, repeats, *args: Any, **kwargs: Any): ... # pyrefly: ignore
8889
def value_counts(self, dropna: bool = True): ...
8990
def map(self, mapper): ...
9091
def isna(self): ...
@@ -108,6 +109,6 @@ class DatetimeLikeArrayMixin(ExtensionOpsMixin, ExtensionArray):
108109
def __rsub__(self, other): ...
109110
def __iadd__(self, other): ...
110111
def __isub__(self, other): ...
111-
def min(self, *, axis=..., skipna: bool = ..., **kwargs): ...
112-
def max(self, *, axis=..., skipna: bool = ..., **kwargs): ...
112+
def min(self, *, axis=..., skipna: bool = ..., **kwargs: Any): ...
113+
def max(self, *, axis=..., skipna: bool = ..., **kwargs: Any): ...
113114
def mean(self, *, skipna: bool = ...): ...

pandas-stubs/core/arrays/integer.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from typing import Any
2+
13
from pandas.core.arrays.masked import BaseMaskedArray
24

35
from pandas._libs.missing import NAType
@@ -17,7 +19,7 @@ class IntegerArray(BaseMaskedArray):
1719
@property
1820
def dtype(self) -> _IntegerDtype: ...
1921
def __init__(self, values, mask, copy: bool = ...) -> None: ...
20-
def __array_ufunc__(self, ufunc, method, *inputs, **kwargs): ...
22+
def __array_ufunc__(self, ufunc, method, *inputs, **kwargs: Any): ...
2123
def __setitem__(self, key, value) -> None: ...
2224
def astype(self, dtype, copy: bool = True): ...
2325

pandas-stubs/core/arrays/interval.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from typing import (
2+
Any,
23
TypeAlias,
34
overload,
45
)
@@ -83,7 +84,7 @@ class IntervalArray(IntervalMixin, ExtensionArray):
8384
allow_fill: bool = ...,
8485
fill_value=...,
8586
axis=...,
86-
**kwargs,
87+
**kwargs: Any,
8788
) -> Self: ...
8889
def value_counts(self, dropna: bool = True): ...
8990
@property

pandas-stubs/core/arrays/numpy_.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from typing import Any
2+
13
import numpy as np
24
from numpy.lib.mixins import NDArrayOperatorsMixin
35
from pandas.core.arrays.base import (
@@ -14,4 +16,4 @@ class PandasDtype(ExtensionDtype):
1416
def itemsize(self) -> int: ...
1517

1618
class PandasArray(ExtensionArray, ExtensionOpsMixin, NDArrayOperatorsMixin):
17-
def __array_ufunc__(self, ufunc, method, *inputs, **kwargs): ...
19+
def __array_ufunc__(self, ufunc, method, *inputs, **kwargs: Any): ...

0 commit comments

Comments
 (0)