Skip to content

Commit 1006fdd

Browse files
Merge remote-tracking branch 'upstream/main' into cow-warning-chained
2 parents 91551fa + 5f88eb1 commit 1006fdd

File tree

95 files changed

+465
-470
lines changed

Some content is hidden

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

95 files changed

+465
-470
lines changed

.github/workflows/unit-tests.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ jobs:
240240
. ~/virtualenvs/pandas-dev/bin/activate
241241
python -m pip install --no-cache-dir -U pip wheel setuptools meson[ninja]==1.2.1 meson-python==0.13.1
242242
python -m pip install numpy --config-settings=setup-args="-Dallow-noblas=true"
243-
python -m pip install --no-cache-dir versioneer[toml] cython python-dateutil pytz pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-asyncio>=0.17 hypothesis>=6.46.1
243+
python -m pip install --no-cache-dir versioneer[toml] cython python-dateutil pytz pytest>=7.3.2 pytest-xdist>=2.2.0 hypothesis>=6.46.1
244244
python -m pip install --no-cache-dir --no-build-isolation -e .
245245
python -m pip list --no-cache-dir
246246
export PANDAS_CI=1
@@ -278,7 +278,7 @@ jobs:
278278
/opt/python/cp311-cp311/bin/python -m venv ~/virtualenvs/pandas-dev
279279
. ~/virtualenvs/pandas-dev/bin/activate
280280
python -m pip install --no-cache-dir -U pip wheel setuptools meson-python==0.13.1 meson[ninja]==1.2.1
281-
python -m pip install --no-cache-dir versioneer[toml] cython numpy python-dateutil pytz pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-asyncio>=0.17 hypothesis>=6.46.1
281+
python -m pip install --no-cache-dir versioneer[toml] cython numpy python-dateutil pytz pytest>=7.3.2 pytest-xdist>=2.2.0 hypothesis>=6.46.1
282282
python -m pip install --no-cache-dir --no-build-isolation -e .
283283
python -m pip list --no-cache-dir
284284
@@ -351,7 +351,7 @@ jobs:
351351
python -m pip install --upgrade pip setuptools wheel meson[ninja]==1.2.1 meson-python==0.13.1
352352
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
353353
python -m pip install versioneer[toml]
354-
python -m pip install python-dateutil pytz tzdata cython hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-cov pytest-asyncio>=0.17
354+
python -m pip install python-dateutil pytz tzdata cython hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-cov
355355
python -m pip install -ve . --no-build-isolation --no-index --no-deps
356356
python -m pip list
357357

.github/workflows/wheels.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ jobs:
181181
shell: pwsh
182182
run: |
183183
$TST_CMD = @"
184-
python -m pip install hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-asyncio>=0.17;
184+
python -m pip install hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0;
185185
python -m pip install `$(Get-Item pandas\wheelhouse\*.whl);
186186
python -c `'import pandas as pd; pd.test(extra_args=[\"`\"--no-strict-data-files`\"\", \"`\"-m not clipboard and not single_cpu and not slow and not network and not db`\"\"])`';
187187
"@

.pre-commit-config.yaml

+9-9
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ ci:
2020
repos:
2121
- repo: https://github.com/hauntsaninja/black-pre-commit-mirror
2222
# black compiled with mypyc
23-
rev: 23.9.1
23+
rev: 23.10.1
2424
hooks:
2525
- id: black
2626
- repo: https://github.com/astral-sh/ruff-pre-commit
27-
rev: v0.0.291
27+
rev: v0.1.4
2828
hooks:
2929
- id: ruff
3030
args: [--exit-non-zero-on-fix]
@@ -34,14 +34,14 @@ repos:
3434
alias: ruff-selected-autofixes
3535
args: [--select, "ANN001,ANN204", --fix-only, --exit-non-zero-on-fix]
3636
- repo: https://github.com/jendrikseipp/vulture
37-
rev: 'v2.9.1'
37+
rev: 'v2.10'
3838
hooks:
3939
- id: vulture
4040
entry: python scripts/run_vulture.py
4141
pass_filenames: true
4242
require_serial: false
4343
- repo: https://github.com/codespell-project/codespell
44-
rev: v2.2.5
44+
rev: v2.2.6
4545
hooks:
4646
- id: codespell
4747
types_or: [python, rst, markdown, cython, c]
@@ -52,7 +52,7 @@ repos:
5252
- id: cython-lint
5353
- id: double-quote-cython-strings
5454
- repo: https://github.com/pre-commit/pre-commit-hooks
55-
rev: v4.4.0
55+
rev: v4.5.0
5656
hooks:
5757
- id: check-ast
5858
- id: check-case-conflict
@@ -71,7 +71,7 @@ repos:
7171
args: [--remove]
7272
- id: trailing-whitespace
7373
- repo: https://github.com/pylint-dev/pylint
74-
rev: v3.0.0b0
74+
rev: v3.0.1
7575
hooks:
7676
- id: pylint
7777
stages: [manual]
@@ -94,7 +94,7 @@ repos:
9494
hooks:
9595
- id: isort
9696
- repo: https://github.com/asottile/pyupgrade
97-
rev: v3.13.0
97+
rev: v3.15.0
9898
hooks:
9999
- id: pyupgrade
100100
args: [--py39-plus]
@@ -111,11 +111,11 @@ repos:
111111
types: [text] # overwrite types: [rst]
112112
types_or: [python, rst]
113113
- repo: https://github.com/sphinx-contrib/sphinx-lint
114-
rev: v0.6.8
114+
rev: v0.8.1
115115
hooks:
116116
- id: sphinx-lint
117117
- repo: https://github.com/pre-commit/mirrors-clang-format
118-
rev: ea59a72
118+
rev: v17.0.4
119119
hooks:
120120
- id: clang-format
121121
files: ^pandas/_libs/src|^pandas/_libs/include

ci/deps/actions-310.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ dependencies:
1414
- pytest>=7.3.2
1515
- pytest-cov
1616
- pytest-xdist>=2.2.0
17-
- pytest-asyncio>=0.17.0
1817
- pytest-localserver>=0.7.1
1918
- boto3
2019

ci/deps/actions-311-downstream_compat.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ dependencies:
1515
- pytest>=7.3.2
1616
- pytest-cov
1717
- pytest-xdist>=2.2.0
18-
- pytest-asyncio>=0.17.0
1918
- pytest-localserver>=0.7.1
2019
- boto3
2120

ci/deps/actions-311-numpydev.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ dependencies:
1818
# causes an InternalError within pytest
1919
- pytest-xdist>=2.2.0, <3
2020
- hypothesis>=6.46.1
21-
- pytest-asyncio>=0.17.0
2221

2322
# pandas dependencies
2423
- python-dateutil

ci/deps/actions-311-pyarrownightly.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ dependencies:
1515
- pytest-cov
1616
- pytest-xdist>=2.2.0
1717
- hypothesis>=6.46.1
18-
- pytest-asyncio>=0.17.0
1918

2019
# required dependencies
2120
- python-dateutil

ci/deps/actions-311.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ dependencies:
1414
- pytest>=7.3.2
1515
- pytest-cov
1616
- pytest-xdist>=2.2.0
17-
- pytest-asyncio>=0.17.0
1817
- pytest-localserver>=0.7.1
1918
- boto3
2019

ci/deps/actions-39-minimum_versions.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ dependencies:
1616
- pytest>=7.3.2
1717
- pytest-cov
1818
- pytest-xdist>=2.2.0
19-
- pytest-asyncio>=0.17.0
2019
- pytest-localserver>=0.7.1
2120
- boto3
2221

ci/deps/actions-39.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ dependencies:
1414
- pytest>=7.3.2
1515
- pytest-cov
1616
- pytest-xdist>=2.2.0
17-
- pytest-asyncio>=0.17.0
1817
- pytest-localserver>=0.7.1
1918
- boto3
2019

ci/deps/actions-pypy-39.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ dependencies:
1616
# test dependencies
1717
- pytest>=7.3.2
1818
- pytest-cov
19-
- pytest-asyncio>=0.17.0
2019
- pytest-xdist>=2.2.0
2120
- hypothesis>=6.46.1
2221

ci/deps/circle-310-arm64.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ dependencies:
1414
- pytest>=7.3.2
1515
- pytest-cov
1616
- pytest-xdist>=2.2.0
17-
- pytest-asyncio>=0.17.0
1817
- pytest-localserver>=0.7.1
1918
- boto3
2019

ci/meta.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ test:
6464
requires:
6565
- pip
6666
- pytest >=7.3.2
67-
- pytest-asyncio >=0.17.0
6867
- pytest-xdist >=2.2.0
6968
- pytest-cov
7069
- hypothesis >=6.46.1

doc/source/development/debugging_extensions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ By default building pandas from source will generate a release build. To generat
2323

2424
.. note::
2525

26-
conda environements update CFLAGS/CPPFLAGS with flags that are geared towards generating releases. If using conda, you may need to set ``CFLAGS="$CFLAGS -O0"`` and ``CPPFLAGS="$CPPFLAGS -O0"`` to ensure optimizations are turned off for debugging
26+
conda environments update CFLAGS/CPPFLAGS with flags that are geared towards generating releases. If using conda, you may need to set ``CFLAGS="$CFLAGS -O0"`` and ``CPPFLAGS="$CPPFLAGS -O0"`` to ensure optimizations are turned off for debugging
2727

2828
By specifying ``builddir="debug"`` all of the targets will be built and placed in the debug directory relative to the project root. This helps to keep your debug and release artifacts separate; you are of course able to choose a different directory name or omit altogether if you do not care to separate build types.
2929

doc/source/development/extending.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ The interface consists of two classes.
9999
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100100

101101
A :class:`pandas.api.extensions.ExtensionDtype` is similar to a ``numpy.dtype`` object. It describes the
102-
data type. Implementors are responsible for a few unique items like the name.
102+
data type. Implementers are responsible for a few unique items like the name.
103103

104104
One particularly important item is the ``type`` property. This should be the
105105
class that is the scalar type for your data. For example, if you were writing an

doc/source/getting_started/tutorials.rst

-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ Various tutorials
115115
* `Statistical Data Analysis in Python, tutorial videos, by Christopher Fonnesbeck from SciPy 2013 <https://conference.scipy.org/scipy2013/tutorial_detail.php?id=109>`_
116116
* `Financial analysis in Python, by Thomas Wiecki <https://nbviewer.org/github/twiecki/financial-analysis-python-tutorial/blob/master/1.%20Pandas%20Basics.ipynb>`_
117117
* `Intro to pandas data structures, by Greg Reda <http://www.gregreda.com/2013/10/26/intro-to-pandas-data-structures/>`_
118-
* `Pandas and Python: Top 10, by Manish Amde <https://manishamde.github.io/blog/2013/03/07/pandas-and-python-top-10/>`_
119118
* `Pandas DataFrames Tutorial, by Karlijn Willems <https://www.datacamp.com/community/tutorials/pandas-tutorial-dataframe-python>`_
120119
* `A concise tutorial with real life examples <https://tutswiki.com/pandas-cookbook/chapter1/>`_
121120
* `430+ Searchable Pandas recipes by Isshin Inada <https://skytowner.com/explore/pandas_recipes_reference>`_

doc/source/user_guide/merging.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ Performing an outer join with duplicate join keys in :class:`DataFrame`
525525
526526
.. warning::
527527

528-
Merging on duplicate keys sigificantly increase the dimensions of the result
528+
Merging on duplicate keys significantly increase the dimensions of the result
529529
and can cause a memory overflow.
530530

531531
.. _merging.validation:

doc/source/user_guide/reshaping.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ The values can be cast to a different type using the ``dtype`` argument.
480480
481481
.. versionadded:: 1.5.0
482482

483-
:func:`~pandas.from_dummies` coverts the output of :func:`~pandas.get_dummies` back into
483+
:func:`~pandas.from_dummies` converts the output of :func:`~pandas.get_dummies` back into
484484
a :class:`Series` of categorical values from indicator values.
485485

486486
.. ipython:: python

doc/source/whatsnew/v1.0.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ Datetimelike
10791079
- Bug in masking datetime-like arrays with a boolean mask of an incorrect length not raising an ``IndexError`` (:issue:`30308`)
10801080
- Bug in :attr:`Timestamp.resolution` being a property instead of a class attribute (:issue:`29910`)
10811081
- Bug in :func:`pandas.to_datetime` when called with ``None`` raising ``TypeError`` instead of returning ``NaT`` (:issue:`30011`)
1082-
- Bug in :func:`pandas.to_datetime` failing for ``deques`` when using ``cache=True`` (the default) (:issue:`29403`)
1082+
- Bug in :func:`pandas.to_datetime` failing for ``dequeues`` when using ``cache=True`` (the default) (:issue:`29403`)
10831083
- Bug in :meth:`Series.item` with ``datetime64`` or ``timedelta64`` dtype, :meth:`DatetimeIndex.item`, and :meth:`TimedeltaIndex.item` returning an integer instead of a :class:`Timestamp` or :class:`Timedelta` (:issue:`30175`)
10841084
- Bug in :class:`DatetimeIndex` addition when adding a non-optimized :class:`DateOffset` incorrectly dropping timezone information (:issue:`30336`)
10851085
- Bug in :meth:`DataFrame.drop` where attempting to drop non-existent values from a DatetimeIndex would yield a confusing error message (:issue:`30399`)

doc/source/whatsnew/v2.2.0.rst

+4
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,11 @@ Performance improvements
324324
- Performance improvement in :meth:`DataFrame.groupby` when aggregating pyarrow timestamp and duration dtypes (:issue:`55031`)
325325
- Performance improvement in :meth:`DataFrame.sort_index` and :meth:`Series.sort_index` when indexed by a :class:`MultiIndex` (:issue:`54835`)
326326
- Performance improvement in :meth:`Index.difference` (:issue:`55108`)
327+
- Performance improvement in :meth:`MultiIndex.get_indexer` when ``method`` is not ``None`` (:issue:`55839`)
327328
- Performance improvement in :meth:`Series.duplicated` for pyarrow dtypes (:issue:`55255`)
329+
- Performance improvement in :meth:`Series.str` methods (:issue:`55736`)
328330
- Performance improvement in :meth:`SeriesGroupBy.idxmax`, :meth:`SeriesGroupBy.idxmin`, :meth:`DataFrameGroupBy.idxmax`, :meth:`DataFrameGroupBy.idxmin` (:issue:`54234`)
331+
- Performance improvement when indexing into a non-unique index (:issue:`55816`)
329332
- Performance improvement when indexing with more than 4 keys (:issue:`54550`)
330333
- Performance improvement when localizing time to UTC (:issue:`55241`)
331334

@@ -346,6 +349,7 @@ Datetimelike
346349
- Bug in :class:`DatetimeIndex` construction when passing both a ``tz`` and either ``dayfirst`` or ``yearfirst`` ignoring dayfirst/yearfirst (:issue:`55813`)
347350
- Bug in :class:`DatetimeIndex` when passing an object-dtype ndarray of float objects and a ``tz`` incorrectly localizing the result (:issue:`55780`)
348351
- Bug in :func:`concat` raising ``AttributeError`` when concatenating all-NA DataFrame with :class:`DatetimeTZDtype` dtype DataFrame. (:issue:`52093`)
352+
- Bug in :func:`testing.assert_extension_array_equal` that could use the wrong unit when comparing resolutions (:issue:`55730`)
349353
- Bug in :func:`to_datetime` and :class:`DatetimeIndex` when passing a list of mixed-string-and-numeric types incorrectly raising (:issue:`55780`)
350354
- Bug in :meth:`DatetimeIndex.union` returning object dtype for tz-aware indexes with the same timezone but different units (:issue:`55238`)
351355
- Bug in :meth:`Index.is_monotonic_increasing` and :meth:`Index.is_monotonic_decreasing` always caching :meth:`Index.is_unique` as ``True`` when first value in index is ``NaT`` (:issue:`55755`)

environment.yml

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ dependencies:
1616
- pytest>=7.3.2
1717
- pytest-cov
1818
- pytest-xdist>=2.2.0
19-
- pytest-asyncio>=0.17.0
2019
- coverage
2120

2221
# required dependencies

pandas/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
try:
2525
# numpy compat
2626
from pandas.compat import (
27-
is_numpy_dev as _is_numpy_dev, # pyright: ignore[reportUnusedImport] # noqa: F401,E501
27+
is_numpy_dev as _is_numpy_dev, # pyright: ignore[reportUnusedImport] # noqa: F401
2828
)
2929
except ImportError as _err: # pragma: no cover
3030
_module = _err.name

pandas/_libs/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# Below imports needs to happen first to ensure pandas top level
1414
# module gets monkeypatched with the pandas_datetime_CAPI
1515
# see pandas_datetime_exec in pd_datetime.c
16-
import pandas._libs.pandas_parser # noqa: E501 # isort: skip # type: ignore[reportUnusedImport]
17-
import pandas._libs.pandas_datetime # noqa: F401,E501 # isort: skip # type: ignore[reportUnusedImport]
16+
import pandas._libs.pandas_parser # isort: skip # type: ignore[reportUnusedImport]
17+
import pandas._libs.pandas_datetime # noqa: F401 # isort: skip # type: ignore[reportUnusedImport]
1818
from pandas._libs.interval import Interval
1919
from pandas._libs.tslibs import (
2020
NaT,

pandas/_libs/dtypes.pxd

+5
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,8 @@ ctypedef fused numeric_t:
3434
ctypedef fused numeric_object_t:
3535
numeric_t
3636
object
37+
38+
ctypedef fused uint8_int64_object_t:
39+
uint8_t
40+
int64_t
41+
object

pandas/_libs/include/pandas/portable.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ The full license is in the LICENSE file, distributed with this software.
2121
#define getdigit_ascii(c, default) \
2222
(isdigit_ascii(c) ? ((int)((c) - '0')) : default)
2323
#define isspace_ascii(c) (((c) == ' ') || (((unsigned)(c) - '\t') < 5))
24-
#define toupper_ascii(c) ((((unsigned)(c) - 'a') < 26) ? ((c)&0x5f) : (c))
24+
#define toupper_ascii(c) ((((unsigned)(c) - 'a') < 26) ? ((c) & 0x5f) : (c))
2525
#define tolower_ascii(c) ((((unsigned)(c) - 'A') < 26) ? ((c) | 0x20) : (c))

pandas/_libs/include/pandas/vendored/ujson/lib/ultrajson.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,13 @@ typedef struct __JSONObjectEncoder {
189189

190190
/*
191191
Begin iteration of an iterable object (JS_ARRAY or JS_OBJECT)
192-
Implementor should setup iteration state in ti->prv
192+
Implementer should setup iteration state in ti->prv
193193
*/
194194
JSPFN_ITERBEGIN iterBegin;
195195

196196
/*
197197
Retrieve next object in an iteration. Should return 0 to indicate iteration
198-
has reached end or 1 if there are more items. Implementor is responsible for
198+
has reached end or 1 if there are more items. Implementer is responsible for
199199
keeping state of the iteration. Use ti->prv fields for this
200200
*/
201201
JSPFN_ITERNEXT iterNext;

pandas/_libs/index.pyi

-7
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,6 @@ class BaseMultiIndexCodesEngine:
8080
) -> None: ...
8181
def get_indexer(self, target: npt.NDArray[np.object_]) -> npt.NDArray[np.intp]: ...
8282
def _extract_level_codes(self, target: MultiIndex) -> np.ndarray: ...
83-
def get_indexer_with_fill(
84-
self,
85-
target: np.ndarray, # np.ndarray[object] of tuples
86-
values: np.ndarray, # np.ndarray[object] of tuples
87-
method: str,
88-
limit: int | None,
89-
) -> npt.NDArray[np.intp]: ...
9083

9184
class ExtensionEngine:
9285
def __init__(self, values: ExtensionArray) -> None: ...

0 commit comments

Comments
 (0)