Skip to content

Commit 95885b8

Browse files
authored
stubtest inconsistencies (#313)
* stubtest inconsistencies * remove deprecated * fix some keyword-only arguments * comments * thin PandasArray * remove imports
1 parent 193095a commit 95885b8

File tree

11 files changed

+10
-125
lines changed

11 files changed

+10
-125
lines changed

pandas-stubs/_libs/tslibs/timestamps.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class Timestamp(datetime):
7777
cls: type[_DatetimeT], t: float, tz: _tzinfo | None = ...
7878
) -> _DatetimeT: ...
7979
@classmethod
80-
def utcfromtimestamp(cls: type[_DatetimeT], t: float) -> _DatetimeT: ...
80+
def utcfromtimestamp(cls: type[_DatetimeT], ts: float) -> _DatetimeT: ...
8181
@classmethod
8282
def today(cls: type[_DatetimeT], tz: _tzinfo | str | None = ...) -> _DatetimeT: ...
8383
@classmethod

pandas-stubs/core/arrays/base.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ExtensionArray:
4747
) -> tuple[np.ndarray, ABCExtensionArray]: ...
4848
def repeat(self, repeats, axis=...): ...
4949
def take(
50-
self, indices: Sequence[int], allow_fill: bool = ..., fill_value=...
50+
self, indices: Sequence[int], *, allow_fill: bool = ..., fill_value=...
5151
) -> ABCExtensionArray: ...
5252
def copy(self) -> ABCExtensionArray: ...
5353
def view(self, dtype=...) -> ABCExtensionArray | np.ndarray: ...

pandas-stubs/core/arrays/interval.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class IntervalArray(IntervalMixin, ExtensionArray):
4444
self, periods: int = ..., fill_value: object = ...
4545
) -> ABCExtensionArray: ...
4646
def take(
47-
self, indices, allow_fill: bool = ..., fill_value=..., axis=..., **kwargs
47+
self, indices, *, allow_fill: bool = ..., fill_value=..., axis=..., **kwargs
4848
): ...
4949
def value_counts(self, dropna: bool = ...): ...
5050
@property

pandas-stubs/core/arrays/numpy_.pyi

-96
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ from pandas.core.arrays.base import (
55
ExtensionOpsMixin,
66
)
77

8-
from pandas._typing import (
9-
Scalar,
10-
npt,
11-
)
12-
138
from pandas.core.dtypes.dtypes import ExtensionDtype
149

1510
class PandasDtype(ExtensionDtype):
@@ -30,95 +25,4 @@ class PandasDtype(ExtensionDtype):
3025
def itemsize(self): ...
3126

3227
class PandasArray(ExtensionArray, ExtensionOpsMixin, NDArrayOperatorsMixin):
33-
__array_priority__: int = ...
34-
def __init__(self, values: np.ndarray | PandasArray, copy: bool = ...) -> None: ...
35-
@property
36-
def dtype(self): ...
37-
def __array__(self, dtype=...) -> np.ndarray: ...
3828
def __array_ufunc__(self, ufunc, method, *inputs, **kwargs): ...
39-
def __getitem__(self, item): ...
40-
def __setitem__(self, key, value) -> None: ...
41-
def __len__(self) -> int: ...
42-
@property
43-
def nbytes(self) -> int: ...
44-
def isna(self): ...
45-
def fillna(self, value=..., method=..., limit=...): ...
46-
def take(self, indices, allow_fill: bool = ..., fill_value=...): ...
47-
def copy(self): ...
48-
def unique(self): ...
49-
def any(self, axis=..., out=..., keepdims: bool = ..., skipna: bool = ...): ...
50-
def all(self, axis=..., out=..., keepdims: bool = ..., skipna: bool = ...): ...
51-
def min(self, axis=..., out=..., keepdims: bool = ..., skipna: bool = ...): ...
52-
def max(self, axis=..., out=..., keepdims: bool = ..., skipna: bool = ...): ...
53-
def sum(
54-
self,
55-
axis=...,
56-
dtype=...,
57-
out=...,
58-
keepdims: bool = ...,
59-
initial=...,
60-
skipna: bool = ...,
61-
min_count: int = ...,
62-
): ...
63-
def prod(
64-
self,
65-
axis=...,
66-
dtype=...,
67-
out=...,
68-
keepdims: bool = ...,
69-
initial=...,
70-
skipna: bool = ...,
71-
min_count: int = ...,
72-
): ...
73-
def mean(
74-
self, axis=..., dtype=..., out=..., keepdims: bool = ..., skipna: bool = ...
75-
): ...
76-
def median(
77-
self,
78-
axis=...,
79-
out=...,
80-
overwrite_input: bool = ...,
81-
keepdims: bool = ...,
82-
skipna: bool = ...,
83-
): ...
84-
def std(
85-
self,
86-
axis=...,
87-
dtype=...,
88-
out=...,
89-
ddof: int = ...,
90-
keepdims: bool = ...,
91-
skipna: bool = ...,
92-
): ...
93-
def var(
94-
self,
95-
axis=...,
96-
dtype=...,
97-
out=...,
98-
ddof: int = ...,
99-
keepdims: bool = ...,
100-
skipna: bool = ...,
101-
): ...
102-
def sem(
103-
self,
104-
axis=...,
105-
dtype=...,
106-
out=...,
107-
ddof: int = ...,
108-
keepdims: bool = ...,
109-
skipna: bool = ...,
110-
): ...
111-
def kurt(
112-
self, axis=..., dtype=..., out=..., keepdims: bool = ..., skipna: bool = ...
113-
): ...
114-
def skew(
115-
self, axis=..., dtype=..., out=..., keepdims: bool = ..., skipna: bool = ...
116-
): ...
117-
def to_numpy(
118-
self,
119-
dtype: npt.DTypeLike | None = ...,
120-
copy: bool = ...,
121-
na_value: Scalar = ...,
122-
) -> np.ndarray: ...
123-
def searchsorted(self, value, side: str = ..., sorter=...): ...
124-
def __invert__(self): ...

pandas-stubs/core/arrays/string_.pyi

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
from pandas.core.arrays import PandasArray as PandasArray
1+
from pandas.core.arrays import PandasArray
22

33
from pandas._typing import type_t
44

5-
from pandas.core.dtypes.base import ExtensionDtype as ExtensionDtype
5+
from pandas.core.dtypes.base import ExtensionDtype
66

77
class StringDtype(ExtensionDtype):
88
name: str = ...

pandas-stubs/core/arrays/timedeltas.pyi

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class TimedeltaArray(DatetimeLikeArrayMixin, TimelikeOps):
1414
def astype(self, dtype, copy: bool = ...): ...
1515
def sum(
1616
self,
17+
*,
1718
axis=...,
1819
dtype=...,
1920
out=...,
@@ -24,6 +25,7 @@ class TimedeltaArray(DatetimeLikeArrayMixin, TimelikeOps):
2425
): ...
2526
def std(
2627
self,
28+
*,
2729
axis=...,
2830
dtype=...,
2931
out=...,
@@ -33,6 +35,7 @@ class TimedeltaArray(DatetimeLikeArrayMixin, TimelikeOps):
3335
): ...
3436
def median(
3537
self,
38+
*,
3639
axis=...,
3740
out=...,
3841
overwrite_input: bool = ...,

pandas-stubs/core/frame.pyi

+1
Original file line numberDiff line numberDiff line change
@@ -1787,6 +1787,7 @@ class DataFrame(NDFrame, OpsMixin):
17871787
min_periods: int | None = ...,
17881788
center: _bool = ...,
17891789
*,
1790+
win_type: None = ...,
17901791
on: Hashable | None = ...,
17911792
axis: AxisType = ...,
17921793
closed: IntervalClosedType | None = ...,

pandas-stubs/core/indexes/timedeltas.pyi

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class TimedeltaIndex(DatetimeTimedeltaMixin, TimedeltaIndexProperties):
3636
def get_value(self, series, key): ...
3737
def get_loc(self, key, tolerance=...): ...
3838
def searchsorted(self, value, side: str = ..., sorter=...): ...
39-
def is_type_compatible(self, typ) -> bool: ...
4039
@property
4140
def inferred_type(self) -> str: ...
4241
def insert(self, loc, item): ...

pandas-stubs/core/missing.pyi

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
def mask_missing(arr, values_to_mask): ...
22
def clean_fill_method(method, allow_nearest: bool = ...): ...
33
def clean_interp_method(method, **kwargs): ...
4-
def find_valid_index(values, how: str): ...
54
def interpolate_2d(
65
values, method: str = ..., axis: int = ..., limit=..., fill_value=..., dtype=...
76
): ...

pandas-stubs/core/series.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -1391,7 +1391,6 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
13911391
self,
13921392
axis: SeriesAxisType | None = ...,
13931393
skipna: _bool = ...,
1394-
*,
13951394
level: None = ...,
13961395
numeric_only: _bool | None = ...,
13971396
**kwargs,
@@ -1528,6 +1527,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
15281527
min_periods: int | None = ...,
15291528
center: _bool = ...,
15301529
*,
1530+
win_type: None = ...,
15311531
on: _str | None = ...,
15321532
axis: SeriesAxisType = ...,
15331533
closed: _str | None = ...,

pandas-stubs/util/_test_decorators.pyi

-21
This file was deleted.

0 commit comments

Comments
 (0)