Skip to content

Commit 74cb8b5

Browse files
committed
Merge remote-tracking branch 'upstream/main' into cow_indexing_midx_slice
# Conflicts: # doc/source/whatsnew/v2.0.0.rst
2 parents ed83c88 + 506fe53 commit 74cb8b5

38 files changed

+366
-182
lines changed

.github/workflows/32-bit-linux.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ on:
55
branches:
66
- main
77
- 2.0.x
8-
- 1.5.x
98
pull_request:
109
branches:
1110
- main
1211
- 2.0.x
13-
- 1.5.x
1412
paths-ignore:
1513
- "doc/**"
1614

.github/workflows/code-checks.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ on:
55
branches:
66
- main
77
- 2.0.x
8-
- 1.5.x
98
pull_request:
109
branches:
1110
- main
1211
- 2.0.x
13-
- 1.5.x
1412

1513
env:
1614
ENV_FILE: environment.yml

.github/workflows/docbuild-and-upload.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ on:
55
branches:
66
- main
77
- 2.0.x
8-
- 1.5.x
98
tags:
109
- '*'
1110
pull_request:
1211
branches:
1312
- main
1413
- 2.0.x
15-
- 1.5.x
1614

1715
env:
1816
ENV_FILE: environment.yml

.github/workflows/macos-windows.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ on:
55
branches:
66
- main
77
- 2.0.x
8-
- 1.5.x
98
pull_request:
109
branches:
1110
- main
1211
- 2.0.x
13-
- 1.5.x
1412
paths-ignore:
1513
- "doc/**"
1614
- "web/**"

.github/workflows/package-checks.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ on:
55
branches:
66
- main
77
- 2.0.x
8-
- 1.5.x
98
pull_request:
109
branches:
1110
- main
1211
- 2.0.x
13-
- 1.5.x
1412
types: [ labeled, opened, synchronize, reopened ]
1513

1614
permissions:

.github/workflows/python-dev.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ name: Python Dev
2323
on:
2424
push:
2525
branches:
26-
# - main
27-
# - 1.5.x
26+
- main
27+
- 2.0.x
2828
- None
2929
pull_request:
3030
branches:
31-
# - main
32-
# - 1.5.x
31+
- main
32+
- 2.0.x
3333
- None
3434
paths-ignore:
3535
- "doc/**"
@@ -47,7 +47,7 @@ permissions:
4747

4848
jobs:
4949
build:
50-
# if: false # Uncomment this to freeze the workflow, comment it to unfreeze
50+
if: false # Uncomment this to freeze the workflow, comment it to unfreeze
5151
runs-on: ${{ matrix.os }}
5252
strategy:
5353
fail-fast: false

.github/workflows/sdist.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ on:
55
branches:
66
- main
77
- 2.0.x
8-
- 1.5.x
98
pull_request:
109
branches:
1110
- main
1211
- 2.0.x
13-
- 1.5.x
1412
types: [labeled, opened, synchronize, reopened]
1513
paths-ignore:
1614
- "doc/**"

.github/workflows/ubuntu.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ on:
55
branches:
66
- main
77
- 2.0.x
8-
- 1.5.x
98
pull_request:
109
branches:
1110
- main
1211
- 2.0.x
13-
- 1.5.x
1412
paths-ignore:
1513
- "doc/**"
1614
- "web/**"

doc/source/whatsnew/v2.0.0.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ Copy-on-Write improvements
209209
- :meth:`DataFrame.__getitem__` will now respect the Copy-on-Write mechanism when the
210210
:class:`DataFrame` has :class:`MultiIndex` columns.
211211

212+
- :meth:`Series.view` will now respect the Copy-on-Write mechanism.
213+
212214
Copy-on-Write can be enabled through one of
213215

214216
.. code-block:: python

doc/source/whatsnew/v2.1.0.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ Performance improvements
117117
- Performance improvement when parsing strings to ``boolean[pyarrow]`` dtype (:issue:`51730`)
118118
- Performance improvement when searching an :class:`Index` sliced from other indexes (:issue:`51738`)
119119
- Performance improvement in :meth:`Series.combine_first` (:issue:`51777`)
120+
- Performance improvement in :meth:`MultiIndex.set_levels` and :meth:`MultiIndex.set_codes` when ``verify_integrity=True`` (:issue:`51873`)
120121
- Performance improvement in :func:`factorize` for object columns not containing strings (:issue:`51921`)
121122

122123
.. ---------------------------------------------------------------------------
@@ -183,7 +184,7 @@ MultiIndex
183184

184185
I/O
185186
^^^
186-
-
187+
- :meth:`DataFrame.to_orc` now raising ``ValueError`` when non-default :class:`Index` is given (:issue:`51828`)
187188
-
188189

189190
Period
@@ -201,6 +202,7 @@ Groupby/resample/rolling
201202
^^^^^^^^^^^^^^^^^^^^^^^^
202203
- Bug in :meth:`DataFrameGroupBy.idxmin`, :meth:`SeriesGroupBy.idxmin`, :meth:`DataFrameGroupBy.idxmax`, :meth:`SeriesGroupBy.idxmax` return wrong dtype when used on empty DataFrameGroupBy or SeriesGroupBy (:issue:`51423`)
203204
- Bug in weighted rolling aggregations when specifying ``min_periods=0`` (:issue:`51449`)
205+
- Bug in :meth:`DataFrame.resample` and :meth:`Series.resample` in incorrectly allowing non-fixed ``freq`` when resampling on a :class:`TimedeltaIndex` (:issue:`51896`)
204206
-
205207

206208
Reshaping
@@ -227,6 +229,7 @@ Styler
227229

228230
Other
229231
^^^^^
232+
-
230233

231234
.. ***DO NOT USE THIS SECTION***
232235

environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,4 @@ dependencies:
118118

119119
- pip:
120120
- sphinx-toggleprompt
121+
- typing_extensions; python_version<"3.11"

pandas/_libs/sparse.pyi

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
from typing import (
2-
Sequence,
3-
TypeVar,
4-
)
1+
from typing import Sequence
52

63
import numpy as np
74

8-
from pandas._typing import npt
9-
10-
_SparseIndexT = TypeVar("_SparseIndexT", bound=SparseIndex)
5+
from pandas._typing import (
6+
Self,
7+
npt,
8+
)
119

1210
class SparseIndex:
1311
length: int
@@ -24,8 +22,8 @@ class SparseIndex:
2422
def lookup_array(self, indexer: npt.NDArray[np.int32]) -> npt.NDArray[np.int32]: ...
2523
def to_int_index(self) -> IntIndex: ...
2624
def to_block_index(self) -> BlockIndex: ...
27-
def intersect(self: _SparseIndexT, y_: SparseIndex) -> _SparseIndexT: ...
28-
def make_union(self: _SparseIndexT, y_: SparseIndex) -> _SparseIndexT: ...
25+
def intersect(self, y_: SparseIndex) -> Self: ...
26+
def make_union(self, y_: SparseIndex) -> Self: ...
2927

3028
class IntIndex(SparseIndex):
3129
indices: npt.NDArray[np.int32]

pandas/_libs/tslibs/offsets.pyi

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ from typing import (
1313
import numpy as np
1414

1515
from pandas._libs.tslibs.nattype import NaTType
16-
from pandas._typing import npt
16+
from pandas._typing import (
17+
Self,
18+
npt,
19+
)
1720

1821
from .timedeltas import Timedelta
1922

@@ -39,40 +42,40 @@ class BaseOffset:
3942
@overload
4043
def __add__(self, other: npt.NDArray[np.object_]) -> npt.NDArray[np.object_]: ...
4144
@overload
42-
def __add__(self: _BaseOffsetT, other: BaseOffset) -> _BaseOffsetT: ...
45+
def __add__(self, other: BaseOffset) -> Self: ...
4346
@overload
4447
def __add__(self, other: _DatetimeT) -> _DatetimeT: ...
4548
@overload
4649
def __add__(self, other: _TimedeltaT) -> _TimedeltaT: ...
4750
@overload
4851
def __radd__(self, other: npt.NDArray[np.object_]) -> npt.NDArray[np.object_]: ...
4952
@overload
50-
def __radd__(self: _BaseOffsetT, other: BaseOffset) -> _BaseOffsetT: ...
53+
def __radd__(self, other: BaseOffset) -> Self: ...
5154
@overload
5255
def __radd__(self, other: _DatetimeT) -> _DatetimeT: ...
5356
@overload
5457
def __radd__(self, other: _TimedeltaT) -> _TimedeltaT: ...
5558
@overload
5659
def __radd__(self, other: NaTType) -> NaTType: ...
57-
def __sub__(self: _BaseOffsetT, other: BaseOffset) -> _BaseOffsetT: ...
60+
def __sub__(self, other: BaseOffset) -> Self: ...
5861
@overload
5962
def __rsub__(self, other: npt.NDArray[np.object_]) -> npt.NDArray[np.object_]: ...
6063
@overload
61-
def __rsub__(self: _BaseOffsetT, other: BaseOffset) -> _BaseOffsetT: ...
64+
def __rsub__(self, other: BaseOffset): ...
6265
@overload
6366
def __rsub__(self, other: _DatetimeT) -> _DatetimeT: ...
6467
@overload
6568
def __rsub__(self, other: _TimedeltaT) -> _TimedeltaT: ...
6669
@overload
6770
def __mul__(self, other: np.ndarray) -> np.ndarray: ...
6871
@overload
69-
def __mul__(self: _BaseOffsetT, other: int) -> _BaseOffsetT: ...
72+
def __mul__(self, other: int): ...
7073
@overload
7174
def __rmul__(self, other: np.ndarray) -> np.ndarray: ...
7275
@overload
73-
def __rmul__(self: _BaseOffsetT, other: int) -> _BaseOffsetT: ...
74-
def __neg__(self: _BaseOffsetT) -> _BaseOffsetT: ...
75-
def copy(self: _BaseOffsetT) -> _BaseOffsetT: ...
76+
def __rmul__(self, other: int) -> Self: ...
77+
def __neg__(self) -> Self: ...
78+
def copy(self) -> Self: ...
7679
@property
7780
def name(self) -> str: ...
7881
@property

pandas/_libs/tslibs/timedeltas.pyi

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ from pandas._libs.tslibs import (
1212
NaTType,
1313
Tick,
1414
)
15-
from pandas._typing import npt
15+
from pandas._typing import (
16+
Self,
17+
npt,
18+
)
1619

1720
# This should be kept consistent with the keys in the dict timedelta_abbrevs
1821
# in pandas/_libs/tslibs/timedeltas.pyx
@@ -111,9 +114,9 @@ class Timedelta(timedelta):
111114
@property
112115
def asm8(self) -> np.timedelta64: ...
113116
# TODO: round/floor/ceil could return NaT?
114-
def round(self: _S, freq: str) -> _S: ...
115-
def floor(self: _S, freq: str) -> _S: ...
116-
def ceil(self: _S, freq: str) -> _S: ...
117+
def round(self, freq: str) -> Self: ...
118+
def floor(self, freq: str) -> Self: ...
119+
def ceil(self, freq: str) -> Self: ...
117120
@property
118121
def resolution_string(self) -> str: ...
119122
def __add__(self, other: timedelta) -> Timedelta: ...

0 commit comments

Comments
 (0)