Skip to content

Commit 2e2ed0f

Browse files
committed
Merge remote-tracking branch 'upstream/main' into cow_inf_obj
2 parents a3d0a2b + b00148b commit 2e2ed0f

File tree

115 files changed

+797
-633
lines changed

Some content is hidden

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

115 files changed

+797
-633
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
. ~/virtualenvs/pandas-dev/bin/activate && \
4040
python -m pip install --no-deps -U pip wheel 'setuptools<60.0.0' && \
4141
python -m pip install versioneer[toml] && \
42-
python -m pip install cython numpy python-dateutil pytz pytest pytest-xdist pytest-asyncio>=0.17 hypothesis && \
42+
python -m pip install cython numpy python-dateutil pytz pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-asyncio>=0.17 hypothesis>=6.34.2 && \
4343
python setup.py build_ext -q -j1 && \
4444
python -m pip install --no-build-isolation --no-use-pep517 -e . && \
4545
python -m pip list && \

.github/workflows/python-dev.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ jobs:
7373
run: |
7474
python --version
7575
python -m pip install --upgrade pip setuptools wheel
76-
python -m pip install --extra-index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy
76+
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy
7777
python -m pip install git+https://github.com/nedbat/coveragepy.git
7878
python -m pip install versioneer[toml]
79-
python -m pip install python-dateutil pytz cython hypothesis==6.52.1 pytest>=6.2.5 pytest-xdist pytest-cov pytest-asyncio>=0.17
79+
python -m pip install python-dateutil pytz cython hypothesis>=6.34.2 pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-cov pytest-asyncio>=0.17
8080
python -m pip list
8181
8282
# GH 47305: Parallel build can cause flaky ImportError from pandas/_libs/tslibs

.github/workflows/wheels.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ jobs:
168168
# (1. Generate sdist 2. Build wheels from sdist)
169169
# This tests the sdists, and saves some build time
170170
python -m pip install dist/*.gz
171-
pip install hypothesis==6.52.1 pytest>=6.2.5 pytest-xdist pytest-asyncio>=0.17
171+
pip install hypothesis>=6.34.2 pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-asyncio>=0.17
172172
cd .. # Not a good idea to test within the src tree
173173
python -c "import pandas; print(pandas.__version__);
174174
pandas.test(extra_args=['-m not clipboard and not single_cpu', '--skip-slow', '--skip-network', '--skip-db', '-n=2']);

asv_bench/asv.conf.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
// pip (with all the conda available packages installed first,
4242
// followed by the pip installed packages).
4343
"matrix": {
44-
"numpy": ["1.23.5"], // https://github.com/pandas-dev/pandas/pull/50356
44+
"numpy": [],
4545
"Cython": ["0.29.32"],
4646
"matplotlib": [],
4747
"sqlalchemy": [],

ci/deps/actions-310-numpydev.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
name: pandas-dev
22
channels:
3-
- defaults
3+
- conda-forge
44
dependencies:
55
- python=3.10
66

77
# build dependencies
88
- versioneer[toml]
99

1010
# test dependencies
11-
- pytest>=6.0
11+
- pytest>=7.0.0
1212
- pytest-cov
13-
- pytest-xdist>=1.31
14-
- hypothesis>=5.5.3
13+
- pytest-xdist>=2.2.0
14+
- hypothesis>=6.34.2
1515
- pytest-asyncio>=0.17
1616

1717
# pandas dependencies
@@ -22,5 +22,5 @@ dependencies:
2222
- "cython"
2323
- "--extra-index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple"
2424
- "--pre"
25-
- "numpy<1.24"
25+
- "numpy"
2626
- "scipy"

ci/deps/actions-310.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ dependencies:
99
- cython>=0.29.32
1010

1111
# test dependencies
12-
- pytest>=6.0
12+
- pytest>=7.0.0
1313
- pytest-cov
14-
- pytest-xdist>=1.31
14+
- pytest-xdist>=2.2.0
1515
- psutil
1616
- pytest-asyncio>=0.17
1717
- boto3
1818

1919
# required dependencies
2020
- python-dateutil
21-
- numpy<1.24
21+
- numpy
2222
- pytz
2323

2424
# optional dependencies

ci/deps/actions-38-downstream_compat.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ dependencies:
1010
- cython>=0.29.32
1111

1212
# test dependencies
13-
- pytest>=6.0
13+
- pytest>=7.0.0
1414
- pytest-cov
15-
- pytest-xdist>=1.31
15+
- pytest-xdist>=2.2.0
1616
- psutil
1717
- pytest-asyncio>=0.17
1818
- boto3
1919

2020
# required dependencies
2121
- python-dateutil
22-
- numpy<1.24
22+
- numpy
2323
- pytz
2424

2525
# optional dependencies

ci/deps/actions-38-minimum_versions.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ dependencies:
1111
- cython>=0.29.32
1212

1313
# test dependencies
14-
- pytest>=6.0
14+
- pytest>=7.0.0
1515
- pytest-cov
16-
- pytest-xdist>=1.31
16+
- pytest-xdist>=2.2.0
1717
- psutil
1818
- pytest-asyncio>=0.17
1919
- boto3
@@ -31,7 +31,7 @@ dependencies:
3131
- fastparquet=0.6.3
3232
- fsspec=2021.07.0
3333
- html5lib=1.1
34-
- hypothesis=6.13.0
34+
- hypothesis=6.34.2
3535
- gcsfs=2021.07.0
3636
- jinja2=3.0.0
3737
- lxml=4.6.3

ci/deps/actions-38.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ dependencies:
99
- cython>=0.29.32
1010

1111
# test dependencies
12-
- pytest>=6.0
12+
- pytest>=7.0.0
1313
- pytest-cov
14-
- pytest-xdist>=1.31
14+
- pytest-xdist>=2.2.0
1515
- psutil
1616
- pytest-asyncio>=0.17
1717
- boto3
1818

1919
# required dependencies
2020
- python-dateutil
21-
- numpy<1.24
21+
- numpy
2222
- pytz
2323

2424
# optional dependencies

ci/deps/actions-39.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ dependencies:
99
- cython>=0.29.32
1010

1111
# test dependencies
12-
- pytest>=6.0
12+
- pytest>=7.0.0
1313
- pytest-cov
14-
- pytest-xdist>=1.31
14+
- pytest-xdist>=2.2.0
1515
- psutil
1616
- pytest-asyncio>=0.17
1717
- boto3
1818

1919
# required dependencies
2020
- python-dateutil
21-
- numpy<1.24
21+
- numpy
2222
- pytz
2323

2424
# optional dependencies

ci/deps/actions-pypy-38.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ dependencies:
1212
- cython>=0.29.32
1313

1414
# test dependencies
15-
- pytest>=6.0
15+
- pytest>=7.0.0
1616
- pytest-cov
1717
- pytest-asyncio
18-
- pytest-xdist>=1.31
19-
- hypothesis>=5.5.3
18+
- pytest-xdist>=2.2.0
19+
- hypothesis>=6.34.2
2020

2121
# required
22-
- numpy<1.24
22+
- numpy
2323
- python-dateutil
2424
- pytz

ci/deps/circle-38-arm64.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ dependencies:
99
- cython>=0.29.32
1010

1111
# test dependencies
12-
- pytest>=6.0
12+
- pytest>=7.0.0
1313
- pytest-cov
14-
- pytest-xdist>=1.31
14+
- pytest-xdist>=2.2.0
1515
- psutil
1616
- pytest-asyncio>=0.17
1717
- boto3
1818

1919
# required dependencies
2020
- python-dateutil
21-
- numpy<1.24
21+
- numpy
2222
- pytz
2323

2424
# optional dependencies

ci/test_wheels_windows.bat

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ pd.test(extra_args=['-m not clipboard and single_cpu', '--skip-slow', '--skip-ne
44

55
python --version
66
pip install pytz six numpy python-dateutil
7-
pip install hypothesis==6.52.1 pytest>=6.2.5 pytest-xdist pytest-asyncio>=0.17
7+
pip install hypothesis>=6.34.2 pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-asyncio>=0.17
88
pip install --find-links=pandas/dist --no-index pandas
9-
python -c "%test_command%"
9+
python -c "%test_command%"

doc/source/getting_started/install.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ pandas is equipped with an exhaustive set of unit tests, covering about 97% of
208208
the code base as of this writing. To run it on your machine to verify that
209209
everything is working (and that you have all of the dependencies, soft and hard,
210210
installed), make sure you have `pytest
211-
<https://docs.pytest.org/en/latest/>`__ >= 6.0 and `Hypothesis
212-
<https://hypothesis.readthedocs.io/en/latest/>`__ >= 6.13.0, then run:
211+
<https://docs.pytest.org/en/latest/>`__ >= 7.0 and `Hypothesis
212+
<https://hypothesis.readthedocs.io/en/latest/>`__ >= 6.34.2, then run:
213213

214214
::
215215

doc/source/whatsnew/v1.5.3.rst

+2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ Fixed regressions
2727

2828
Bug fixes
2929
~~~~~~~~~
30+
- Bug in the Copy-on-Write implementation losing track of views when indexing a :class:`DataFrame` with another :class:`DataFrame` (:issue:`50630`)
3031
- Bug in :meth:`.Styler.to_excel` leading to error when unrecognized ``border-style`` (e.g. ``"hair"``) provided to Excel writers (:issue:`48649`)
32+
- Bug in :meth:`Series.quantile` emitting warning from NumPy when :class:`Series` has only ``NA`` values (:issue:`50681`)
3133
- Bug when chaining several :meth:`.Styler.concat` calls, only the last styler was concatenated (:issue:`49207`)
3234
- Fixed bug when instantiating a :class:`DataFrame` subclass inheriting from ``typing.Generic`` that triggered a ``UserWarning`` on python 3.11 (:issue:`49649`)
3335
-

doc/source/whatsnew/v2.0.0.rst

+49-34
Original file line numberDiff line numberDiff line change
@@ -83,34 +83,40 @@ be set to ``"pyarrow"`` to return pyarrow-backed, nullable :class:`ArrowDtype` (
8383
df_pyarrow = pd.read_csv(data, use_nullable_dtypes=True, engine="pyarrow")
8484
df_pyarrow.dtypes
8585
86-
Copy on write improvements
86+
Copy-on-Write improvements
8787
^^^^^^^^^^^^^^^^^^^^^^^^^^
8888

89-
A new lazy copy mechanism that defers the copy until the object in question is modified
90-
was added to the following methods:
91-
92-
- :meth:`DataFrame.reset_index` / :meth:`Series.reset_index`
93-
- :meth:`DataFrame.set_index` / :meth:`Series.set_index`
94-
- :meth:`DataFrame.set_axis` / :meth:`Series.set_axis`
95-
- :meth:`DataFrame.rename_axis` / :meth:`Series.rename_axis`
96-
- :meth:`DataFrame.rename_columns`
97-
- :meth:`DataFrame.reindex` / :meth:`Series.reindex`
98-
- :meth:`DataFrame.reindex_like` / :meth:`Series.reindex_like`
99-
- :meth:`DataFrame.assign`
100-
- :meth:`DataFrame.drop`
101-
- :meth:`DataFrame.dropna` / :meth:`Series.dropna`
102-
- :meth:`DataFrame.select_dtypes`
103-
- :meth:`DataFrame.align` / :meth:`Series.align`
104-
- :meth:`Series.to_frame`
105-
- :meth:`DataFrame.rename` / :meth:`Series.rename`
106-
- :meth:`DataFrame.add_prefix` / :meth:`Series.add_prefix`
107-
- :meth:`DataFrame.add_suffix` / :meth:`Series.add_suffix`
108-
- :meth:`DataFrame.drop_duplicates` / :meth:`Series.drop_duplicates`
109-
- :meth:`DataFrame.reorder_levels` / :meth:`Series.reorder_levels`
110-
111-
These methods return views when copy on write is enabled, which provides a significant
112-
performance improvement compared to the regular execution (:issue:`49473`). Copy on write
113-
can be enabled through
89+
- A new lazy copy mechanism that defers the copy until the object in question is modified
90+
was added to the following methods:
91+
92+
- :meth:`DataFrame.reset_index` / :meth:`Series.reset_index`
93+
- :meth:`DataFrame.set_index` / :meth:`Series.set_index`
94+
- :meth:`DataFrame.set_axis` / :meth:`Series.set_axis`
95+
- :meth:`DataFrame.rename_axis` / :meth:`Series.rename_axis`
96+
- :meth:`DataFrame.rename_columns`
97+
- :meth:`DataFrame.reindex` / :meth:`Series.reindex`
98+
- :meth:`DataFrame.reindex_like` / :meth:`Series.reindex_like`
99+
- :meth:`DataFrame.assign`
100+
- :meth:`DataFrame.drop`
101+
- :meth:`DataFrame.dropna` / :meth:`Series.dropna`
102+
- :meth:`DataFrame.select_dtypes`
103+
- :meth:`DataFrame.align` / :meth:`Series.align`
104+
- :meth:`Series.to_frame`
105+
- :meth:`DataFrame.rename` / :meth:`Series.rename`
106+
- :meth:`DataFrame.add_prefix` / :meth:`Series.add_prefix`
107+
- :meth:`DataFrame.add_suffix` / :meth:`Series.add_suffix`
108+
- :meth:`DataFrame.drop_duplicates` / :meth:`Series.drop_duplicates`
109+
- :meth:`DataFrame.reorder_levels` / :meth:`Series.reorder_levels`
110+
111+
These methods return views when Copy-on-Write is enabled, which provides a significant
112+
performance improvement compared to the regular execution (:issue:`49473`).
113+
114+
- Accessing a single column of a DataFrame as a Series (e.g. ``df["col"]``) now always
115+
returns a new object every time it is constructed when Copy-on-Write is enabled (not
116+
returning multiple times an identical, cached Series object). This ensures that those
117+
Series objects correctly follow the Copy-on-Write rules (:issue:`49450`)
118+
119+
Copy-on-Write can be enabled through
114120

115121
.. code-block:: python
116122
@@ -447,13 +453,19 @@ Increased minimum versions for dependencies
447453
Some minimum supported versions of dependencies were updated.
448454
If installed, we now require:
449455

450-
+-----------------+-----------------+----------+---------+
451-
| Package | Minimum Version | Required | Changed |
452-
+=================+=================+==========+=========+
453-
| mypy (dev) | 0.991 | | X |
454-
+-----------------+-----------------+----------+---------+
455-
| python-dateutil | 2.8.2 | X | X |
456-
+-----------------+-----------------+----------+---------+
456+
+-------------------+-----------------+----------+---------+
457+
| Package | Minimum Version | Required | Changed |
458+
+===================+=================+==========+=========+
459+
| mypy (dev) | 0.991 | | X |
460+
+-------------------+-----------------+----------+---------+
461+
| pytest (dev) | 7.0.0 | | X |
462+
+-------------------+-----------------+----------+---------+
463+
| pytest-xdist (dev)| 2.2.0 | | X |
464+
+-------------------+-----------------+----------+---------+
465+
| hypothesis (dev) | 6.34.2 | | X |
466+
+-------------------+-----------------+----------+---------+
467+
| python-dateutil | 2.8.2 | X | X |
468+
+-------------------+-----------------+----------+---------+
457469

458470
For `optional libraries <https://pandas.pydata.org/docs/getting_started/install.html>`_ the general recommendation is to use the latest version.
459471
The following table lists the lowest version per library that is currently being tested throughout the development of pandas.
@@ -556,9 +568,12 @@ Other API changes
556568
Deprecations
557569
~~~~~~~~~~~~
558570
- Deprecated argument ``infer_datetime_format`` in :func:`to_datetime` and :func:`read_csv`, as a strict version of it is now the default (:issue:`48621`)
571+
- Deprecated :func:`pandas.io.sql.execute`(:issue:`50185`)
572+
-
559573

560-
.. ---------------------------------------------------------------------------
574+
- :meth:`Index.is_floating` has been deprecated. Use :func:`pandas.api.types.is_float_dtype` instead (:issue:`50042`)
561575

576+
.. ---------------------------------------------------------------------------
562577
.. _whatsnew_200.prior_deprecations:
563578

564579
Removal of prior version deprecations/changes

environment.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ dependencies:
1111
- cython=0.29.32
1212

1313
# test dependencies
14-
- pytest>=6.0
14+
- pytest>=7.0.0
1515
- pytest-cov
16-
- pytest-xdist>=1.31
16+
- pytest-xdist>=2.2.0
1717
- psutil
1818
- pytest-asyncio>=0.17
1919
- coverage
2020

2121
# required dependencies
2222
- python-dateutil
23-
- numpy<1.24
23+
- numpy
2424
- pytz
2525

2626
# optional dependencies

pandas/_libs/tslib.pyx

-3
Original file line numberDiff line numberDiff line change
@@ -546,9 +546,6 @@ cpdef array_to_datetime(
546546
else:
547547
# coerce
548548
# we now need to parse this as if unit='ns'
549-
# we can ONLY accept integers at this point
550-
# if we have previously (or in future accept
551-
# datetimes/strings, then we must coerce)
552549
try:
553550
iresult[i] = cast_from_unit(val, "ns")
554551
except OverflowError:

pandas/_libs/tslibs/conversion.pxd

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ cdef tzinfo convert_timezone(
5252
)
5353

5454
cdef int64_t parse_pydatetime(
55-
object val,
55+
datetime val,
5656
npy_datetimestruct *dts,
5757
bint utc_convert,
5858
) except? -1

0 commit comments

Comments
 (0)