Skip to content

Commit 129d5af

Browse files
committed
Merge remote-tracking branch 'upstream/master' into typ_c_parser
2 parents 30c46b2 + 85c221a commit 129d5af

File tree

99 files changed

+1452
-934
lines changed

Some content is hidden

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

99 files changed

+1452
-934
lines changed

.github/workflows/posix.yml

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
[actions-38-slow.yaml, "slow", "", "", "", "", ""],
3232
[actions-38-locale.yaml, "not slow and not network", "language-pack-zh-hans xsel", "zh_CN.utf8", "zh_CN.utf8", "", ""],
3333
[actions-39-slow.yaml, "slow", "", "", "", "", ""],
34+
[actions-pypy-38.yaml, "not slow and not clipboard", "", "", "", "", ""],
3435
[actions-39-numpydev.yaml, "not slow and not network", "xsel", "", "", "deprecate", "-W error"],
3536
[actions-39.yaml, "not slow and not clipboard", "", "", "", "", ""]
3637
]

.github/workflows/python-dev.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,9 @@ jobs:
4949
shell: bash
5050
run: |
5151
python -m pip install --upgrade pip setuptools wheel
52-
# TODO: unpin
53-
pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple "numpy==1.23.0.dev0+101.ga81535a36"
52+
pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy
5453
pip install git+https://github.com/nedbat/coveragepy.git
55-
pip install cython python-dateutil pytz hypothesis pytest>=6.2.5 pytest-xdist pytest-cov pytest-timeout
54+
pip install cython python-dateutil pytz hypothesis pytest>=6.2.5 pytest-xdist pytest-cov
5655
pip list
5756
5857
- name: Build Pandas

azure-pipelines.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
/opt/python/cp38-cp38/bin/python -m venv ~/virtualenvs/pandas-dev && \
4444
. ~/virtualenvs/pandas-dev/bin/activate && \
4545
python -m pip install --no-deps -U pip wheel setuptools && \
46-
pip install cython numpy python-dateutil pytz pytest pytest-xdist hypothesis pytest-azurepipelines pytest-timeout && \
46+
pip install cython numpy python-dateutil pytz pytest pytest-xdist hypothesis pytest-azurepipelines && \
4747
python setup.py build_ext -q -j2 && \
4848
python -m pip install --no-build-isolation -e . && \
4949
pytest -m 'not slow and not network and not clipboard' pandas --junitxml=test-data.xml"

ci/deps/actions-38-db-min.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ dependencies:
99
- pytest>=6.0
1010
- pytest-cov
1111
- pytest-xdist>=1.31
12-
- pytest-timeout
1312
- hypothesis>=5.5.3
1413

1514
# required

ci/deps/actions-38-db.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ dependencies:
88
- cython>=0.29.24
99
- pytest>=6.0
1010
- pytest-xdist>=1.31
11-
- pytest-timeout
1211
- hypothesis>=5.5.3
1312
- pytest-cov>=2.10.1 # this is only needed in the coverage build, ref: GH 35737
1413

ci/deps/actions-38-locale.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ dependencies:
99
- pytest>=6.0
1010
- pytest-cov
1111
- pytest-xdist>=1.31
12-
- pytest-timeout
1312
- pytest-asyncio>=0.12.0
1413
- hypothesis>=5.5.3
1514

ci/deps/actions-38-locale_slow.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ dependencies:
1010
- pytest>=6.0
1111
- pytest-cov
1212
- pytest-xdist>=1.31
13-
- pytest-timeout
1413
- hypothesis>=5.5.3
1514

1615
# pandas dependencies

ci/deps/actions-38-minimum_versions.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ dependencies:
99
- pytest>=6.0
1010
- pytest-cov
1111
- pytest-xdist>=1.31
12-
- pytest-timeout
1312
- hypothesis>=5.5.3
1413
- psutil
1514

ci/deps/actions-38-slow.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ dependencies:
99
- pytest>=6.0
1010
- pytest-cov
1111
- pytest-xdist>=1.31
12-
- pytest-timeout
1312
- hypothesis>=5.5.3
1413

1514
# pandas dependencies

ci/deps/actions-38.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ dependencies:
1010
- pytest>=6.0
1111
- pytest-cov
1212
- pytest-xdist>=1.31
13-
- pytest-timeout
1413
- hypothesis>=5.5.3
1514

1615
# pandas dependencies

ci/deps/actions-39-numpydev.yaml

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ dependencies:
88
- pytest>=6.0
99
- pytest-cov
1010
- pytest-xdist>=1.31
11-
- pytest-timeout
1211
- hypothesis>=5.5.3
1312

1413
# pandas dependencies
@@ -19,6 +18,5 @@ dependencies:
1918
- cython==0.29.24 # GH#34014
2019
- "--extra-index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple"
2120
- "--pre"
22-
# TODO: Unpin
23-
- "numpy==1.23.0.dev0+101.ga81535a36"
21+
- "numpy"
2422
- "scipy"

ci/deps/actions-39-slow.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ dependencies:
1010
- pytest>=6.0
1111
- pytest-cov
1212
- pytest-xdist>=1.31
13-
- pytest-timeout
1413
- hypothesis>=5.5.3
1514

1615
# pandas dependencies

ci/deps/actions-39.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ dependencies:
99
- pytest>=6.0
1010
- pytest-cov
1111
- pytest-xdist>=1.31
12-
- pytest-timeout
1312
- hypothesis>=5.5.3
1413

1514
# pandas dependencies

ci/deps/actions-pypy-38.yaml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: pandas-dev
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
# TODO: Add the rest of the dependencies in here
6+
# once the other plentiful failures/segfaults
7+
# with base pandas has been dealt with
8+
- python=3.8
9+
10+
# tools
11+
- cython>=0.29.24
12+
- pytest>=6.0
13+
- pytest-cov
14+
- pytest-xdist>=1.31
15+
- hypothesis>=5.5.3
16+
17+
# required
18+
- numpy
19+
- python-dateutil
20+
- pytz

ci/deps/azure-macos-38.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ dependencies:
88
# tools
99
- pytest>=6.0
1010
- pytest-xdist>=1.31
11-
- pytest-timeout
1211
- hypothesis>=5.5.3
1312
- pytest-azurepipelines
1413

ci/deps/azure-windows-38.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ dependencies:
99
- cython>=0.29.24
1010
- pytest>=6.0
1111
- pytest-xdist>=1.31
12-
- pytest-timeout
1312
- hypothesis>=5.5.3
1413
- pytest-azurepipelines
1514

ci/deps/azure-windows-39.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ dependencies:
99
- cython>=0.29.24
1010
- pytest>=6.0
1111
- pytest-xdist>=1.31
12-
- pytest-timeout
1312
- hypothesis>=5.5.3
1413
- pytest-azurepipelines
1514

ci/deps/circle-38-arm64.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ dependencies:
88
- cython>=0.29.24
99
- pytest>=6.0
1010
- pytest-xdist>=1.31
11-
- pytest-timeout
1211
- hypothesis>=5.5.3
1312

1413
# pandas dependencies

doc/source/whatsnew/v1.3.5.rst

+2-19
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. _whatsnew_135:
22

3-
What's new in 1.3.5 (November ??, 2021)
3+
What's new in 1.3.5 (December 12, 2021)
44
---------------------------------------
55

66
These are the changes in pandas 1.3.5. See :ref:`release` for a full changelog
@@ -21,25 +21,8 @@ Fixed regressions
2121
- Fixed performance regression in :func:`read_csv` (:issue:`44106`)
2222
- Fixed regression in :meth:`Series.duplicated` and :meth:`Series.drop_duplicates` when Series has :class:`Categorical` dtype with boolean categories (:issue:`44351`)
2323
- Fixed regression in :meth:`.GroupBy.sum` with ``timedelta64[ns]`` dtype containing ``NaT`` failing to treat that value as NA (:issue:`42659`)
24-
-
24+
- Fixed regression in :meth:`.RollingGroupby.cov` and :meth:`.RollingGroupby.corr` when ``other`` had the same shape as each group would incorrectly return superfluous groups in the result (:issue:`42915`)
2525

26-
.. ---------------------------------------------------------------------------
27-
28-
.. _whatsnew_135.bug_fixes:
29-
30-
Bug fixes
31-
~~~~~~~~~
32-
-
33-
-
34-
35-
.. ---------------------------------------------------------------------------
36-
37-
.. _whatsnew_135.other:
38-
39-
Other
40-
~~~~~
41-
-
42-
-
4326

4427
.. ---------------------------------------------------------------------------
4528

doc/source/whatsnew/v1.4.0.rst

+9-2
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ Other enhancements
219219
- :meth:`DataFrame.dropna` now accepts a single label as ``subset`` along with array-like (:issue:`41021`)
220220
- :class:`ExcelWriter` argument ``if_sheet_exists="overlay"`` option added (:issue:`40231`)
221221
- :meth:`read_excel` now accepts a ``decimal`` argument that allow the user to specify the decimal point when parsing string columns to numeric (:issue:`14403`)
222-
- :meth:`.GroupBy.mean` now supports `Numba <http://numba.pydata.org/>`_ execution with the ``engine`` keyword (:issue:`43731`)
222+
- :meth:`.GroupBy.mean`, :meth:`.GroupBy.std`, and :meth:`.GroupBy.var` now supports `Numba <http://numba.pydata.org/>`_ execution with the ``engine`` keyword (:issue:`43731`, :issue:`44862`)
223223
- :meth:`Timestamp.isoformat`, now handles the ``timespec`` argument from the base :class:``datetime`` class (:issue:`26131`)
224224
- :meth:`NaT.to_numpy` ``dtype`` argument is now respected, so ``np.timedelta64`` can be returned (:issue:`44460`)
225225
- New option ``display.max_dir_items`` customizes the number of columns added to :meth:`Dataframe.__dir__` and suggested for tab completion (:issue:`37996`)
@@ -229,6 +229,8 @@ Other enhancements
229229
- :meth:`Series.info` has been added, for compatibility with :meth:`DataFrame.info` (:issue:`5167`)
230230
- Implemented :meth:`IntervalArray.min`, :meth:`IntervalArray.max`, as a result of which ``min`` and ``max`` now work for :class:`IntervalIndex`, :class:`Series` and :class:`DataFrame` with ``IntervalDtype`` (:issue:`44746`)
231231
- :meth:`UInt64Index.map` now retains ``dtype`` where possible (:issue:`44609`)
232+
- :meth:`read_json` can now parse unsigned long long integers (:issue:`26068`)
233+
- :meth:`DataFrame.take` now raises a ``TypeError`` when passed a scalar for the indexer (:issue:`42875`)
232234
-
233235

234236

@@ -658,7 +660,7 @@ Conversion
658660

659661
Strings
660662
^^^^^^^
661-
-
663+
- Fixed bug in checking for ``string[pyarrow]`` dtype incorrectly raising an ImportError when pyarrow is not installed (:issue:`44327`)
662664
-
663665

664666
Interval
@@ -697,8 +699,10 @@ Indexing
697699
- Bug in :meth:`DataFrame.loc.__getitem__` incorrectly raising ``KeyError`` when selecting a single column with a boolean key (:issue:`44322`).
698700
- Bug in setting :meth:`DataFrame.iloc` with a single ``ExtensionDtype`` column and setting 2D values e.g. ``df.iloc[:] = df.values`` incorrectly raising (:issue:`44514`)
699701
- Bug in indexing on columns with ``loc`` or ``iloc`` using a slice with a negative step with ``ExtensionDtype`` columns incorrectly raising (:issue:`44551`)
702+
- Bug in :meth:`DataFrame.loc.__setitem__` changing dtype when indexer was completely ``False`` (:issue:`37550`)
700703
- Bug in :meth:`IntervalIndex.get_indexer_non_unique` returning boolean mask instead of array of integers for a non unique and non monotonic index (:issue:`44084`)
701704
- Bug in :meth:`IntervalIndex.get_indexer_non_unique` not handling targets of ``dtype`` 'object' with NaNs correctly (:issue:`44482`)
705+
- Fixed regression where a single column ``np.matrix`` was no longer coerced to a 1d ``np.ndarray`` when added to a :class:`DataFrame` (:issue:`42376`)
702706
-
703707

704708
Missing
@@ -707,13 +711,15 @@ Missing
707711
- Bug in :meth:`DataFrame.fillna` not replacing missing values when using a dict-like ``value`` and duplicate column names (:issue:`43476`)
708712
- Bug in constructing a :class:`DataFrame` with a dictionary ``np.datetime64`` as a value and ``dtype='timedelta64[ns]'``, or vice-versa, incorrectly casting instead of raising (:issue:`??`)
709713
- Bug in :meth:`Series.interpolate` and :meth:`DataFrame.interpolate` with ``inplace=True`` not writing to the underlying array(s) in-place (:issue:`44749`)
714+
- Bug in :meth:`Index.fillna` incorrectly returning an un-filled :class:`Index` when NA values are present and ``downcast`` argument is specified. This now raises ``NotImplementedError`` instead; do not pass ``downcast`` argument (:issue:`44873`)
710715
-
711716

712717
MultiIndex
713718
^^^^^^^^^^
714719
- Bug in :meth:`MultiIndex.get_loc` where the first level is a :class:`DatetimeIndex` and a string key is passed (:issue:`42465`)
715720
- Bug in :meth:`MultiIndex.reindex` when passing a ``level`` that corresponds to an ``ExtensionDtype`` level (:issue:`42043`)
716721
- Bug in :meth:`MultiIndex.get_loc` raising ``TypeError`` instead of ``KeyError`` on nested tuple (:issue:`42440`)
722+
- Bug in :meth:`MultiIndex.union` setting wrong ``sortorder`` causing errors in subsequent indexing operations with slices (:issue:`44752`)
717723
- Bug in :meth:`MultiIndex.putmask` where the other value was also a :class:`MultiIndex` (:issue:`43212`)
718724
-
719725

@@ -749,6 +755,7 @@ I/O
749755
- :meth:`DataFrame.to_csv` and :meth:`Series.to_csv` with ``compression`` set to ``'zip'`` no longer create a zip file containing a file ending with ".zip". Instead, they try to infer the inner file name more smartly. (:issue:`39465`)
750756
- Bug in :func:`read_csv` when passing simultaneously a parser in ``date_parser`` and ``parse_dates=False``, the parsing was still called (:issue:`44366`)
751757
- Bug in :func:`read_csv` silently ignoring errors when failling to create a memory-mapped file (:issue:`44766`)
758+
- Bug in :func:`read_csv` when passing a ``tempfile.SpooledTemporaryFile`` opened in binary mode (:issue:`44748`)
752759
-
753760

754761
Period

environment.yml

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ dependencies:
6161
- pytest>=6.0
6262
- pytest-cov
6363
- pytest-xdist>=1.31
64-
- pytest-timeout
6564
- pytest-asyncio
6665
- pytest-instafail
6766

pandas/_libs/interval.pyx

+3-3
Original file line numberDiff line numberDiff line change
@@ -516,9 +516,9 @@ def intervals_to_interval_bounds(ndarray intervals, bint validate_closed=True):
516516
517517
Returns
518518
-------
519-
tuple of tuples
520-
left : (ndarray, object, array)
521-
right : (ndarray, object, array)
519+
tuple of
520+
left : ndarray
521+
right : ndarray
522522
closed: str
523523
"""
524524
cdef:

pandas/_libs/join.pyi

+6-6
Original file line numberDiff line numberDiff line change
@@ -55,39 +55,39 @@ def asof_join_backward_on_X_by_Y(
5555
left_by_values: np.ndarray, # by_t[:]
5656
right_by_values: np.ndarray, # by_t[:]
5757
allow_exact_matches: bool = ...,
58-
tolerance=...,
58+
tolerance: np.number | int | float | None = ...,
5959
) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...
6060
def asof_join_forward_on_X_by_Y(
6161
left_values: np.ndarray, # asof_t[:]
6262
right_values: np.ndarray, # asof_t[:]
6363
left_by_values: np.ndarray, # by_t[:]
6464
right_by_values: np.ndarray, # by_t[:]
6565
allow_exact_matches: bool = ...,
66-
tolerance=...,
66+
tolerance: np.number | int | float | None = ...,
6767
) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...
6868
def asof_join_nearest_on_X_by_Y(
6969
left_values: np.ndarray, # asof_t[:]
7070
right_values: np.ndarray, # asof_t[:]
7171
left_by_values: np.ndarray, # by_t[:]
7272
right_by_values: np.ndarray, # by_t[:]
7373
allow_exact_matches: bool = ...,
74-
tolerance=...,
74+
tolerance: np.number | int | float | None = ...,
7575
) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...
7676
def asof_join_backward(
7777
left_values: np.ndarray, # asof_t[:]
7878
right_values: np.ndarray, # asof_t[:]
7979
allow_exact_matches: bool = ...,
80-
tolerance=...,
80+
tolerance: np.number | int | float | None = ...,
8181
) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...
8282
def asof_join_forward(
8383
left_values: np.ndarray, # asof_t[:]
8484
right_values: np.ndarray, # asof_t[:]
8585
allow_exact_matches: bool = ...,
86-
tolerance=...,
86+
tolerance: np.number | int | float | None = ...,
8787
) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...
8888
def asof_join_nearest(
8989
left_values: np.ndarray, # asof_t[:]
9090
right_values: np.ndarray, # asof_t[:]
9191
allow_exact_matches: bool = ...,
92-
tolerance=...,
92+
tolerance: np.number | int | float | None = ...,
9393
) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...

pandas/_libs/missing.pyi

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import numpy as np
2+
from numpy import typing as npt
3+
4+
class NAType: ...
5+
6+
NA: NAType
7+
8+
def is_matching_na(
9+
left: object, right: object, nan_matches_none: bool = ...
10+
) -> bool: ...
11+
def isposinf_scalar(val: object) -> bool: ...
12+
def isneginf_scalar(val: object) -> bool: ...
13+
def checknull(val: object, inf_as_na: bool = ...) -> bool: ...
14+
def isnaobj(arr: np.ndarray, inf_as_na: bool = ...) -> npt.NDArray[np.bool_]: ...
15+
def is_numeric_na(values: np.ndarray) -> npt.NDArray[np.bool_]: ...

pandas/_libs/ops.pyi

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from typing import (
22
Any,
33
Callable,
4+
Iterable,
45
Literal,
56
overload,
67
)
@@ -35,15 +36,15 @@ def vec_binop(
3536
@overload
3637
def maybe_convert_bool(
3738
arr: npt.NDArray[np.object_],
38-
true_values=...,
39-
false_values=...,
39+
true_values: Iterable = ...,
40+
false_values: Iterable = ...,
4041
convert_to_masked_nullable: Literal[False] = ...,
4142
) -> tuple[np.ndarray, None]: ...
4243
@overload
4344
def maybe_convert_bool(
4445
arr: npt.NDArray[np.object_],
45-
true_values=...,
46-
false_values=...,
46+
true_values: Iterable = ...,
47+
false_values: Iterable = ...,
4748
*,
4849
convert_to_masked_nullable: Literal[True],
4950
) -> tuple[np.ndarray, np.ndarray]: ...

pandas/_libs/ops_dispatch.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ UFUNC_ALIASES = {
3434
"true_divide": "truediv",
3535
"power": "pow",
3636
"remainder": "mod",
37-
"divide": "div",
37+
"divide": "truediv",
3838
"equal": "eq",
3939
"not_equal": "ne",
4040
"less": "lt",

pandas/_libs/src/ujson/lib/ultrajson.h

+1
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ typedef struct __JSONObjectDecoder {
297297
JSOBJ (*endArray)(void *prv, JSOBJ obj);
298298
JSOBJ (*newInt)(void *prv, JSINT32 value);
299299
JSOBJ (*newLong)(void *prv, JSINT64 value);
300+
JSOBJ (*newUnsignedLong)(void *prv, JSUINT64 value);
300301
JSOBJ (*newDouble)(void *prv, double value);
301302
void (*releaseObject)(void *prv, JSOBJ obj, void *decoder);
302303
JSPFN_MALLOC malloc;

0 commit comments

Comments
 (0)