Skip to content

Commit 9a65eb3

Browse files
Merge branch 'main' into gh1419_index_where
2 parents 9cf063f + 6957ad1 commit 9a65eb3

File tree

27 files changed

+400
-152
lines changed

27 files changed

+400
-152
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
matrix:
2020
# macos-latest is arm
2121
os: [ubuntu-latest, windows-latest, macos-latest]
22-
python-version: ["3.10", "3.11", "3.12", "3.13"]
22+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
2323

2424
name: OS ${{ matrix.os }} - Python ${{ matrix.python-version }}
2525

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ci:
33
autofix_prs: false
44
repos:
55
- repo: https://github.com/astral-sh/ruff-pre-commit
6-
rev: v0.14.0
6+
rev: v0.14.2
77
hooks:
88
- id: ruff-check
99
args: [--exit-non-zero-on-fix]

pandas-stubs/_testing/__init__.pyi

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,6 @@ def assert_timedelta_array_equal(
9292
obj: str = "TimedeltaArray",
9393
check_freq: bool = True,
9494
) -> None: ...
95-
def assert_numpy_array_equal(
96-
left,
97-
right,
98-
strict_nan: bool = False,
99-
check_dtype: bool | Literal["equiv"] = True,
100-
err_msg: str | None = None,
101-
check_same: Literal["copy", "same"] | None = None,
102-
obj: str = "numpy array",
103-
index_values: Index | np.ndarray | None = None,
104-
) -> None: ...
10595
def assert_extension_array_equal(
10696
left: ExtensionArray,
10797
right: ExtensionArray,
@@ -173,7 +163,6 @@ def assert_frame_equal(
173163
atol: float = 1e-8,
174164
obj: str = "DataFrame",
175165
) -> None: ...
176-
def assert_equal(left, right, **kwargs: Any) -> None: ...
177166
def assert_sp_array_equal(left: SparseArray, right: SparseArray) -> None: ...
178167
def assert_contains_all(iterable: Iterable[T], dic: Container[T]) -> None: ...
179168
def assert_copy(iter1: Iterable[T], iter2: Iterable[T], **eql_kwargs: Any) -> None: ...

pandas-stubs/_typing.pyi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -911,8 +911,10 @@ SeriesDType: TypeAlias = (
911911
S1 = TypeVar("S1", bound=SeriesDType, default=Any)
912912
# Like S1, but without `default=Any`.
913913
S2 = TypeVar("S2", bound=SeriesDType)
914-
S2_CT = TypeVar("S2_CT", bound=SeriesDType, contravariant=True)
915-
S2_CT_NDT = TypeVar("S2_CT_NDT", bound=SeriesDTypeNoDateTime, contravariant=True)
914+
S2_contra = TypeVar("S2_contra", bound=SeriesDType, contravariant=True)
915+
S2_NDT_contra = TypeVar(
916+
"S2_NDT_contra", bound=SeriesDTypeNoDateTime, contravariant=True
917+
)
916918
S2_NSDT = TypeVar("S2_NSDT", bound=SeriesDTypeNoStrDateTime)
917919
S3 = TypeVar("S3", bound=SeriesDType)
918920

pandas-stubs/core/algorithms.pyi

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from typing import (
2+
Any,
23
Literal,
34
overload,
45
)
@@ -72,9 +73,9 @@ def value_counts(
7273
dropna: bool = True,
7374
) -> Series: ...
7475
def take(
75-
arr,
76+
arr: np.ndarray | ExtensionArray | Index | Series,
7677
indices: TakeIndexer,
7778
axis: Literal[0, 1] = 0,
7879
allow_fill: bool = False,
79-
fill_value=None,
80-
): ...
80+
fill_value: Any = None,
81+
) -> np_1darray | ExtensionArray: ...

pandas-stubs/core/arrays/interval.pyi

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ from typing import (
55
)
66

77
import numpy as np
8-
from pandas import (
9-
Index,
10-
Series,
11-
)
128
from pandas.core.arrays.base import ExtensionArray as ExtensionArray
9+
from pandas.core.indexes.base import Index
10+
from pandas.core.series import Series
1311
from typing_extensions import Self
1412

1513
from pandas._libs.interval import (
@@ -32,15 +30,15 @@ class IntervalArray(IntervalMixin, ExtensionArray):
3230
can_hold_na: bool = ...
3331
def __new__(
3432
cls, data, closed=..., dtype=..., copy: bool = ..., verify_integrity: bool = ...
35-
): ...
33+
) -> Self: ...
3634
@classmethod
3735
def from_breaks(
3836
cls,
3937
breaks,
4038
closed: str = "right",
4139
copy: bool = False,
4240
dtype=None,
43-
): ...
41+
) -> Self: ...
4442
@classmethod
4543
def from_arrays(
4644
cls,
@@ -49,15 +47,15 @@ class IntervalArray(IntervalMixin, ExtensionArray):
4947
closed: str = "right",
5048
copy: bool = False,
5149
dtype=...,
52-
): ...
50+
) -> Self: ...
5351
@classmethod
5452
def from_tuples(
5553
cls,
5654
data,
5755
closed: str = "right",
5856
copy: bool = False,
5957
dtype=None,
60-
): ...
58+
) -> Self: ...
6159
def __array__(
6260
self, dtype: NpDtype | None = None, copy: bool | None = None
6361
) -> np_1darray: ...

pandas-stubs/core/arrays/sparse/accessor.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
from pandas import Series
21
from pandas.core.accessor import PandasDelegate
2+
from pandas.core.series import Series
3+
from typing_extensions import Self
34

45
class BaseAccessor:
56
def __init__(self, data=...) -> None: ...
@@ -12,7 +13,7 @@ class SparseAccessor(BaseAccessor, PandasDelegate):
1213

1314
class SparseFrameAccessor(BaseAccessor, PandasDelegate):
1415
@classmethod
15-
def from_spmatrix(cls, data, index=..., columns=...): ...
16+
def from_spmatrix(cls, data, index=..., columns=...) -> Self: ...
1617
def to_dense(self): ...
1718
def to_coo(self): ...
1819
@property

pandas-stubs/core/arrays/sparse/array.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class SparseArray(ExtensionArray, ExtensionOpsMixin):
3333
copy: bool = ...,
3434
) -> None: ...
3535
@classmethod
36-
def from_spmatrix(cls, data): ...
36+
def from_spmatrix(cls, data) -> Self: ...
3737
def __array__(
3838
self, dtype: NpDtype | None = None, copy: bool | None = None
3939
) -> np_1darray: ...

pandas-stubs/core/frame.pyi

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ from pandas._typing import (
169169
from pandas.io.formats.style import Styler
170170
from pandas.plotting import PlotAccessor
171171

172-
_T_MUTABLE_MAPPING = TypeVar("_T_MUTABLE_MAPPING", bound=MutableMapping, covariant=True)
172+
_T_MUTABLE_MAPPING_co = TypeVar(
173+
"_T_MUTABLE_MAPPING_co", bound=MutableMapping, covariant=True
174+
)
173175

174176
class _iLocIndexerFrame(_iLocIndexer, Generic[_T]):
175177
@overload
@@ -463,9 +465,9 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
463465
self,
464466
orient: Literal["records"],
465467
*,
466-
into: _T_MUTABLE_MAPPING | type[_T_MUTABLE_MAPPING],
468+
into: _T_MUTABLE_MAPPING_co | type[_T_MUTABLE_MAPPING_co],
467469
index: Literal[True] = ...,
468-
) -> list[_T_MUTABLE_MAPPING]: ...
470+
) -> list[_T_MUTABLE_MAPPING_co]: ...
469471
@overload
470472
def to_dict(
471473
self,
@@ -511,9 +513,9 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
511513
self,
512514
orient: Literal["dict", "list", "series"] = ...,
513515
*,
514-
into: _T_MUTABLE_MAPPING | type[_T_MUTABLE_MAPPING],
516+
into: _T_MUTABLE_MAPPING_co | type[_T_MUTABLE_MAPPING_co],
515517
index: Literal[True] = ...,
516-
) -> _T_MUTABLE_MAPPING: ...
518+
) -> _T_MUTABLE_MAPPING_co: ...
517519
@overload
518520
def to_dict(
519521
self,
@@ -2225,6 +2227,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
22252227
fill_method: None = None,
22262228
freq: Frequency | dt.timedelta | None = ...,
22272229
fill_value: Scalar | NAType | None = ...,
2230+
axis: Axis | None = ...,
22282231
) -> Self: ...
22292232
def pop(self, item: _str) -> Series: ...
22302233
def pow(

pandas-stubs/core/groupby/groupby.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ class GroupBy(BaseGroupBy[NDFrameT]):
302302
periods: int | Sequence[int] = 1,
303303
freq: Frequency | None = ...,
304304
axis: Axis | _NoDefaultDoNotUse = 0,
305-
fill_value=...,
305+
fill_value: Scalar | None = None,
306306
suffix: str | None = ...,
307307
) -> NDFrameT: ...
308308
@final

0 commit comments

Comments
 (0)