Skip to content

Commit 186b457

Browse files
authored
Merge branch 'main' into bugfix-spss-kwargs
2 parents d1b0ece + dc5586b commit 186b457

File tree

25 files changed

+158
-101
lines changed

25 files changed

+158
-101
lines changed

.github/workflows/wheels.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ jobs:
139139

140140
- name: Build normal wheels
141141
if: ${{ (env.IS_SCHEDULE_DISPATCH != 'true' || env.IS_PUSH == 'true') }}
142-
uses: pypa/[email protected].2
142+
uses: pypa/[email protected].4
143143
with:
144144
package-dir: ./dist/${{ matrix.buildplat[1] == 'macosx_*' && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
145145
env:
@@ -148,7 +148,7 @@ jobs:
148148

149149
- name: Build nightly wheels (with NumPy pre-release)
150150
if: ${{ (env.IS_SCHEDULE_DISPATCH == 'true' && env.IS_PUSH != 'true') }}
151-
uses: pypa/[email protected].2
151+
uses: pypa/[email protected].4
152152
with:
153153
package-dir: ./dist/${{ matrix.buildplat[1] == 'macosx_*' && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
154154
env:

ci/code_checks.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
9595
pandas.PeriodIndex.strftime\
9696
pandas.Series.clip\
9797
pandas.Series.rename_axis\
98-
pandas.Series.interpolate\
9998
pandas.Series.dt.to_period\
10099
pandas.Series.dt.tz_localize\
101100
pandas.Series.dt.tz_convert\
@@ -162,9 +161,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
162161
pandas.tseries.offsets.Milli\
163162
pandas.tseries.offsets.Micro\
164163
pandas.tseries.offsets.Nano\
165-
pandas.describe_option\
166-
pandas.reset_option\
167-
pandas.get_option\
168164
pandas.set_option\
169165
pandas.Timestamp.max\
170166
pandas.Timestamp.min\
@@ -186,8 +182,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
186182
pandas.core.groupby.DataFrameGroupBy.hist\
187183
pandas.core.groupby.DataFrameGroupBy.plot\
188184
pandas.core.groupby.SeriesGroupBy.plot\
189-
pandas.read_hdf\
190-
pandas.HDFStore.append\
191185
pandas.core.window.rolling.Rolling.quantile\
192186
pandas.core.window.expanding.Expanding.quantile\
193187
pandas.api.extensions.ExtensionArray.argsort # There should be no backslash in the final line, please keep this comment in the last ignored function

doc/source/user_guide/missing_data.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use :class:`api.types.NaTType`.
3030
pd.Series(["2020", "2020"], dtype=pd.PeriodDtype("D")).reindex([0, 1, 2])
3131
3232
:class:`NA` for :class:`StringDtype`, :class:`Int64Dtype` (and other bit widths),
33-
:class:`Float64Dtype`(and other bit widths), :class:`BooleanDtype` and :class:`ArrowDtype`.
33+
:class:`Float64Dtype` (and other bit widths), :class:`BooleanDtype` and :class:`ArrowDtype`.
3434
These types will maintain the original data type of the data.
3535
For typing applications, use :class:`api.types.NAType`.
3636

doc/source/whatsnew/v2.2.1.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Fixed regressions
1919
- Fixed regression in :func:`wide_to_long` raising an ``AttributeError`` for string columns (:issue:`57066`)
2020
- Fixed regression in :meth:`DataFrameGroupBy.idxmin`, :meth:`DataFrameGroupBy.idxmax`, :meth:`SeriesGroupBy.idxmin`, :meth:`SeriesGroupBy.idxmax` ignoring the ``skipna`` argument (:issue:`57040`)
2121
- Fixed regression in :meth:`DataFrameGroupBy.idxmin`, :meth:`DataFrameGroupBy.idxmax`, :meth:`SeriesGroupBy.idxmin`, :meth:`SeriesGroupBy.idxmax` where values containing the minimum or maximum value for the dtype could produce incorrect results (:issue:`57040`)
22+
- Fixed regression in :meth:`Index.join` raising ``TypeError`` when joining an empty index to a non-empty index containing mixed dtype values (:issue:`57048`)
2223
- Fixed regression in :meth:`Series.pct_change` raising a ``ValueError`` for an empty :class:`Series` (:issue:`57056`)
2324

2425
.. ---------------------------------------------------------------------------

pandas/_config/config.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,17 @@
5454
ContextDecorator,
5555
contextmanager,
5656
)
57+
from inspect import signature
5758
import re
5859
from typing import (
5960
TYPE_CHECKING,
6061
Any,
6162
Callable,
6263
Generic,
64+
Literal,
6365
NamedTuple,
6466
cast,
67+
overload,
6568
)
6669
import warnings
6770

@@ -270,6 +273,7 @@ class CallableDynamicDoc(Generic[T]):
270273
def __init__(self, func: Callable[..., T], doc_tmpl: str) -> None:
271274
self.__doc_tmpl__ = doc_tmpl
272275
self.__func__ = func
276+
self.__signature__ = signature(func)
273277

274278
def __call__(self, *args, **kwds) -> T:
275279
return self.__func__(*args, **kwds)
@@ -740,7 +744,23 @@ def _build_option_description(k: str) -> str:
740744
return s
741745

742746

743-
def pp_options_list(keys: Iterable[str], width: int = 80, _print: bool = False):
747+
@overload
748+
def pp_options_list(
749+
keys: Iterable[str], *, width: int = ..., _print: Literal[False] = ...
750+
) -> str:
751+
...
752+
753+
754+
@overload
755+
def pp_options_list(
756+
keys: Iterable[str], *, width: int = ..., _print: Literal[True]
757+
) -> None:
758+
...
759+
760+
761+
def pp_options_list(
762+
keys: Iterable[str], *, width: int = 80, _print: bool = False
763+
) -> str | None:
744764
"""Builds a concise listing of available options, grouped by prefix"""
745765
from itertools import groupby
746766
from textwrap import wrap
@@ -770,8 +790,7 @@ def pp(name: str, ks: Iterable[str]) -> list[str]:
770790
s = "\n".join(ls)
771791
if _print:
772792
print(s)
773-
else:
774-
return s
793+
return s
775794

776795

777796
#

pandas/_libs/arrays.pyi

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ class NDArrayBacked:
1414
_ndarray: np.ndarray
1515
def __init__(self, values: np.ndarray, dtype: DtypeObj) -> None: ...
1616
@classmethod
17-
def _simple_new(cls, values: np.ndarray, dtype: DtypeObj): ...
18-
def _from_backing_data(self, values: np.ndarray): ...
19-
def __setstate__(self, state): ...
17+
def _simple_new(cls, values: np.ndarray, dtype: DtypeObj) -> Self: ...
18+
def _from_backing_data(self, values: np.ndarray) -> Self: ...
19+
def __setstate__(self, state) -> None: ...
2020
def __len__(self) -> int: ...
2121
@property
2222
def shape(self) -> Shape: ...
@@ -26,14 +26,14 @@ class NDArrayBacked:
2626
def size(self) -> int: ...
2727
@property
2828
def nbytes(self) -> int: ...
29-
def copy(self, order=...): ...
30-
def delete(self, loc, axis=...): ...
31-
def swapaxes(self, axis1, axis2): ...
32-
def repeat(self, repeats: int | Sequence[int], axis: int | None = ...): ...
33-
def reshape(self, *args, **kwargs): ...
34-
def ravel(self, order=...): ...
29+
def copy(self, order=...) -> Self: ...
30+
def delete(self, loc, axis=...) -> Self: ...
31+
def swapaxes(self, axis1, axis2) -> Self: ...
32+
def repeat(self, repeats: int | Sequence[int], axis: int | None = ...) -> Self: ...
33+
def reshape(self, *args, **kwargs) -> Self: ...
34+
def ravel(self, order=...) -> Self: ...
3535
@property
36-
def T(self): ...
36+
def T(self) -> Self: ...
3737
@classmethod
3838
def _concat_same_type(
3939
cls, to_concat: Sequence[Self], axis: AxisInt = ...

pandas/_libs/testing.pyi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
def assert_dict_equal(a, b, compare_keys: bool = ...): ...
1+
from typing import Mapping
2+
3+
def assert_dict_equal(a: Mapping, b: Mapping, compare_keys: bool = ...) -> bool: ...
24
def assert_almost_equal(
35
a,
46
b,
@@ -9,4 +11,4 @@ def assert_almost_equal(
911
lobj=...,
1012
robj=...,
1113
index_values=...,
12-
): ...
14+
) -> bool: ...

pandas/_libs/tslibs/dtypes.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from enum import Enum
22

3+
from pandas._typing import Self
4+
35
OFFSET_TO_PERIOD_FREQSTR: dict[str, str]
46

57
def periods_per_day(reso: int = ...) -> int: ...
@@ -12,7 +14,7 @@ class PeriodDtypeBase:
1214
_n: int
1315

1416
# actually __cinit__
15-
def __new__(cls, code: int, n: int): ...
17+
def __new__(cls, code: int, n: int) -> Self: ...
1618
@property
1719
def _freq_group_code(self) -> int: ...
1820
@property

pandas/_libs/tslibs/offsets.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ class BaseOffset:
6464
@overload
6565
def __rsub__(self, other: npt.NDArray[np.object_]) -> npt.NDArray[np.object_]: ...
6666
@overload
67-
def __rsub__(self, other: BaseOffset): ...
67+
def __rsub__(self, other: BaseOffset) -> Self: ...
6868
@overload
6969
def __rsub__(self, other: _DatetimeT) -> _DatetimeT: ...
7070
@overload
7171
def __rsub__(self, other: _TimedeltaT) -> _TimedeltaT: ...
7272
@overload
7373
def __mul__(self, other: np.ndarray) -> np.ndarray: ...
7474
@overload
75-
def __mul__(self, other: int): ...
75+
def __mul__(self, other: int) -> Self: ...
7676
@overload
7777
def __rmul__(self, other: np.ndarray) -> np.ndarray: ...
7878
@overload
@@ -100,7 +100,7 @@ def _get_offset(name: str) -> BaseOffset: ...
100100

101101
class SingleConstructorOffset(BaseOffset):
102102
@classmethod
103-
def _from_name(cls, suffix: None = ...): ...
103+
def _from_name(cls, suffix: None = ...) -> Self: ...
104104
def __reduce__(self): ...
105105

106106
@overload

pandas/_testing/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ def iat(x):
482482
_UNITS = ["s", "ms", "us", "ns"]
483483

484484

485-
def get_finest_unit(left: str, right: str):
485+
def get_finest_unit(left: str, right: str) -> str:
486486
"""
487487
Find the higher of two datetime64 units.
488488
"""

0 commit comments

Comments
 (0)