Skip to content

Commit 4d1c818

Browse files
Merge remote-tracking branch 'upstream/main' into update-DataFrame.from_records
2 parents 2c145f5 + 0815d44 commit 4d1c818

File tree

218 files changed

+12567
-5152
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+12567
-5152
lines changed

.github/setup/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ runs:
1313
using: composite
1414
steps:
1515
- name: Set up Python
16-
uses: actions/setup-python@v5
16+
uses: actions/setup-python@v6
1717
with:
1818
python-version: ${{ inputs.python-version }}
1919

.github/workflows/comment_commands.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
# get the sha of the last commit to attach the results of the tests
2626
if: always()
2727
id: get-branch-info
28-
uses: actions/github-script@v7
28+
uses: actions/github-script@v8
2929
with:
3030
github-token: ${{ secrets.GITHUB_TOKEN }}
3131
script: |
@@ -39,7 +39,7 @@ jobs:
3939
core.setOutput('repository', pr.data.head.repo.full_name)
4040
4141
- name: Checkout code on the correct branch
42-
uses: actions/checkout@v4
42+
uses: actions/checkout@v5
4343
with:
4444
# context is not aware which branch to checkout so it would otherwise
4545
# default to main (we also need repo name to source from the right user
@@ -61,7 +61,7 @@ jobs:
6161
- name: Report results of the tests and publish
6262
# publish the results to a check run no matter the pass or fail
6363
if: always()
64-
uses: actions/github-script@v7
64+
uses: actions/github-script@v8
6565
with:
6666
github-token: ${{ secrets.GITHUB_TOKEN }}
6767
script: |

.github/workflows/optional.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
timeout-minutes: 10
1313

1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v5
1616

1717
- name: Install project dependencies
1818
uses: ./.github/setup
@@ -28,7 +28,7 @@ jobs:
2828
timeout-minutes: 10
2929

3030
steps:
31-
- uses: actions/checkout@v3
31+
- uses: actions/checkout@v5
3232

3333
- name: Install project dependencies
3434
uses: ./.github/setup
@@ -44,7 +44,7 @@ jobs:
4444
timeout-minutes: 10
4545

4646
steps:
47-
- uses: actions/checkout@v3
47+
- uses: actions/checkout@v5
4848

4949
- name: Install project dependencies
5050
uses: ./.github/setup

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ 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

2626
steps:
27-
- uses: actions/checkout@v4
27+
- uses: actions/checkout@v5
2828

2929
- name: Install project dependencies
3030
uses: ./.github/setup
@@ -55,6 +55,6 @@ jobs:
5555
timeout-minutes: 10
5656

5757
steps:
58-
- uses: actions/checkout@v4
58+
- uses: actions/checkout@v5
5959

60-
- uses: pre-commit/action@v3.0.0
60+
- uses: pre-commit/action@v3.0.1

.pre-commit-config.yaml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,22 @@ minimum_pre_commit_version: 2.15.0
22
ci:
33
autofix_prs: false
44
repos:
5-
- repo: https://github.com/python/black
6-
rev: 25.1.0
7-
hooks:
8-
- id: black
9-
- repo: https://github.com/PyCQA/isort
10-
rev: 6.0.1
11-
hooks:
12-
- id: isort
135
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.12.10
6+
rev: v0.14.2
157
hooks:
168
- id: ruff-check
17-
args: [
18-
--exit-non-zero-on-fix,
19-
--target-version, py39,
20-
--extend-select, "PYI,UP,RUF100",
21-
--ignore, "E501,E731,F841,PYI042",
22-
--per-file-ignores, "_*.pyi:PYI001",
23-
--fix
24-
]
9+
args: [--exit-non-zero-on-fix]
2510
- repo: https://github.com/codespell-project/codespell
2611
rev: v2.4.1
2712
hooks:
2813
- id: codespell
2914
additional_dependencies: [ tomli ]
3015
args: [-L, "THIRDPARTY"]
16+
- repo: https://github.com/PyCQA/isort
17+
rev: 6.0.1
18+
hooks:
19+
- id: isort
20+
- repo: https://github.com/psf/black
21+
rev: 25.9.0
22+
hooks:
23+
- id: black

conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
from collections.abc import Generator
12
import gc
23

34
import pytest
45

56

67
@pytest.fixture
7-
def mpl_cleanup():
8+
def mpl_cleanup() -> Generator[None, None, None]:
89
"""
910
Ensure Matplotlib is cleaned up around a test.
1011

docs/philosophy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ revealed by `mypy` as follows:
5555
```text
5656
ttest.py:5: note: Revealed type is "pandas.core.series.Series[pandas._libs.tslibs.timestamps.Timestamp]"
5757
ttest.py:7: note: Revealed type is "pandas.core.series.Series[pandas._libs.tslibs.timestamps.Timestamp]"
58-
ttest.py:9: note: Revealed type is "pandas.core.series.TimedeltaSeries"
58+
ttest.py:9: note: Revealed type is "pandas.core.series.Series[pandas._libs.tslibs.timestamps.Timedelta]"
5959
ttest.py:10: error: Unsupported operand types for + ("Series[Timestamp]" and "Series[Timestamp]") [operator]
6060
```
6161

6262
The type `Series[Timestamp]` is the result of creating a series from `pd.to_datetime()`, while
63-
the type `TimedeltaSeries` is the result of subtracting two `Series[Timestamp]` as well as
63+
the type `Series[Timedelta]` is the result of subtracting two `Series[Timestamp]` as well as
6464
the result of `pd.to_timedelta()`.
6565

6666
### Progressive arithmetic typing for generic Series

pandas-stubs/__init__.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ from pandas._config import (
9494
)
9595

9696
from pandas.util._print_versions import show_versions as show_versions
97-
from pandas.util._tester import test as test
9897

9998
from pandas.io.api import (
10099
ExcelFile as ExcelFile,

pandas-stubs/_config/config.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def reset_option(pat: str) -> None: ...
1515
@overload
1616
def describe_option(pat: str, _print_desc: Literal[False]) -> str: ...
1717
@overload
18-
def describe_option(pat: str, _print_desc: Literal[True] = ...) -> None: ...
18+
def describe_option(pat: str, _print_desc: Literal[True] = True) -> None: ...
1919

2020
class DictWrapper:
2121
def __init__(self, d: dict[str, Any], prefix: str = ...) -> None: ...

pandas-stubs/_libs/interval.pyi

Lines changed: 18 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,21 @@ from typing import (
44
Literal,
55
TypeVar,
66
overload,
7+
type_check_only,
78
)
89

9-
import numpy as np
1010
from pandas import (
1111
IntervalIndex,
1212
Series,
1313
Timedelta,
1414
Timestamp,
1515
)
16-
from pandas.core.series import TimedeltaSeries
1716

1817
from pandas._typing import (
1918
IntervalClosedType,
2019
IntervalT,
21-
np_1darray,
22-
npt,
20+
np_1darray_bool,
21+
np_ndarray,
2322
)
2423

2524
VALID_CLOSED: frozenset[str]
@@ -28,6 +27,7 @@ _OrderableScalarT = TypeVar("_OrderableScalarT", bound=int | float)
2827
_OrderableTimesT = TypeVar("_OrderableTimesT", bound=Timestamp | Timedelta)
2928
_OrderableT = TypeVar("_OrderableT", bound=int | float | Timestamp | Timedelta)
3029

30+
@type_check_only
3131
class _LengthDescriptor:
3232
@overload
3333
def __get__(
@@ -38,8 +38,9 @@ class _LengthDescriptor:
3838
self, instance: Interval[_OrderableTimesT], owner: Any
3939
) -> Timedelta: ...
4040
@overload
41-
def __get__(self, instance: IntervalTree, owner: Any) -> np.ndarray: ...
41+
def __get__(self, instance: IntervalMixin, owner: Any) -> np_ndarray: ...
4242

43+
@type_check_only
4344
class _MidDescriptor:
4445
@overload
4546
def __get__(self, instance: Interval[_OrderableScalarT], owner: Any) -> float: ...
@@ -48,7 +49,7 @@ class _MidDescriptor:
4849
self, instance: Interval[_OrderableTimesT], owner: Any
4950
) -> _OrderableTimesT: ...
5051
@overload
51-
def __get__(self, instance: IntervalTree, owner: Any) -> np.ndarray: ...
52+
def __get__(self, instance: IntervalMixin, owner: Any) -> np_ndarray: ...
5253

5354
class IntervalMixin:
5455
@property
@@ -69,8 +70,8 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
6970
def right(self: Interval[_OrderableT]) -> _OrderableT: ...
7071
@property
7172
def closed(self) -> IntervalClosedType: ...
72-
mid: _MidDescriptor
73-
length: _LengthDescriptor
73+
mid = _MidDescriptor()
74+
length = _LengthDescriptor()
7475
def __init__(
7576
self,
7677
left: _OrderableT,
@@ -167,78 +168,47 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
167168
@overload
168169
def __gt__(self, other: Interval[_OrderableT]) -> bool: ...
169170
@overload
170-
def __gt__(
171-
self: IntervalT, other: IntervalIndex[IntervalT]
172-
) -> np_1darray[np.bool]: ...
171+
def __gt__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_1darray_bool: ...
173172
@overload
174173
def __gt__(
175174
self,
176-
other: Series[int] | Series[float] | Series[Timestamp] | TimedeltaSeries,
175+
other: Series[int] | Series[float] | Series[Timestamp] | Series[Timedelta],
177176
) -> Series[bool]: ...
178177
@overload
179178
def __lt__(self, other: Interval[_OrderableT]) -> bool: ...
180179
@overload
181-
def __lt__(
182-
self: IntervalT, other: IntervalIndex[IntervalT]
183-
) -> np_1darray[np.bool]: ...
180+
def __lt__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_1darray_bool: ...
184181
@overload
185182
def __lt__(
186183
self,
187-
other: Series[int] | Series[float] | Series[Timestamp] | TimedeltaSeries,
184+
other: Series[int] | Series[float] | Series[Timestamp] | Series[Timedelta],
188185
) -> Series[bool]: ...
189186
@overload
190187
def __ge__(self, other: Interval[_OrderableT]) -> bool: ...
191188
@overload
192-
def __ge__(
193-
self: IntervalT, other: IntervalIndex[IntervalT]
194-
) -> np_1darray[np.bool]: ...
189+
def __ge__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_1darray_bool: ...
195190
@overload
196191
def __ge__(
197192
self,
198-
other: Series[int] | Series[float] | Series[Timestamp] | TimedeltaSeries,
193+
other: Series[int] | Series[float] | Series[Timestamp] | Series[Timedelta],
199194
) -> Series[bool]: ...
200195
@overload
201196
def __le__(self, other: Interval[_OrderableT]) -> bool: ...
202197
@overload
203-
def __le__(
204-
self: IntervalT, other: IntervalIndex[IntervalT]
205-
) -> np_1darray[np.bool]: ...
198+
def __le__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_1darray_bool: ...
206199
@overload
207200
def __eq__(self, other: Interval[_OrderableT]) -> bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
208201
@overload
209-
def __eq__(
210-
self: IntervalT, other: IntervalIndex[IntervalT]
211-
) -> np_1darray[np.bool]: ...
202+
def __eq__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_1darray_bool: ...
212203
@overload
213204
def __eq__(self, other: Series[_OrderableT]) -> Series[bool]: ... # type: ignore[overload-overlap]
214205
@overload
215206
def __eq__(self, other: object) -> Literal[False]: ...
216207
@overload
217208
def __ne__(self, other: Interval[_OrderableT]) -> bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
218209
@overload
219-
def __ne__(
220-
self: IntervalT, other: IntervalIndex[IntervalT]
221-
) -> np_1darray[np.bool]: ...
210+
def __ne__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_1darray_bool: ...
222211
@overload
223212
def __ne__(self, other: Series[_OrderableT]) -> Series[bool]: ... # type: ignore[overload-overlap]
224213
@overload
225214
def __ne__(self, other: object) -> Literal[True]: ...
226-
227-
class IntervalTree(IntervalMixin):
228-
def __init__(
229-
self,
230-
left: np.ndarray,
231-
right: np.ndarray,
232-
closed: IntervalClosedType = ...,
233-
leaf_size: int = ...,
234-
) -> None: ...
235-
def get_indexer(self, target) -> npt.NDArray[np.intp]: ...
236-
def get_indexer_non_unique(
237-
self, target
238-
) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...
239-
_na_count: int
240-
@property
241-
def is_overlapping(self) -> bool: ...
242-
@property
243-
def is_monotonic_increasing(self) -> bool: ...
244-
def clear_mapping(self) -> None: ...

0 commit comments

Comments
 (0)