Skip to content

Commit 3d70cf9

Browse files
committed
Merge remote-tracking branch 'upstream/main' into cow_putmask_2
# Conflicts: # pandas/tests/copy_view/test_methods.py
2 parents 00c0f12 + 8b96ef2 commit 3d70cf9

Some content is hidden

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

61 files changed

+359
-228
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
python -m pip install --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

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Bug fixes
2929
~~~~~~~~~
3030
- Bug in the Copy-on-Write implementation losing track of views when indexing a :class:`DataFrame` with another :class:`DataFrame` (:issue:`50630`)
3131
- 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`)
3233
- Bug when chaining several :meth:`.Styler.concat` calls, only the last styler was concatenated (:issue:`49207`)
3334
- Fixed bug when instantiating a :class:`DataFrame` subclass inheriting from ``typing.Generic`` that triggered a ``UserWarning`` on python 3.11 (:issue:`49649`)
3435
-

doc/source/whatsnew/v2.0.0.rst

+17-8
Original file line numberDiff line numberDiff line change
@@ -447,13 +447,19 @@ Increased minimum versions for dependencies
447447
Some minimum supported versions of dependencies were updated.
448448
If installed, we now require:
449449

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

458464
For `optional libraries <https://pandas.pydata.org/docs/getting_started/install.html>`_ the general recommendation is to use the latest version.
459465
The following table lists the lowest version per library that is currently being tested throughout the development of pandas.
@@ -556,9 +562,12 @@ Other API changes
556562
Deprecations
557563
~~~~~~~~~~~~
558564
- 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`)
565+
- Deprecated :func:`pandas.io.sql.execute`(:issue:`50185`)
566+
-
559567

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

570+
.. ---------------------------------------------------------------------------
562571
.. _whatsnew_200.prior_deprecations:
563572

564573
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

pandas/_libs/tslibs/conversion.pyx

+7-8
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,8 @@ cdef _TSObject _create_tsobject_tz_using_offset(npy_datetimestruct dts,
413413
414414
Parameters
415415
----------
416-
dts: npy_datetimestruct
417-
tzoffset: int
416+
dts : npy_datetimestruct
417+
tzoffset : int
418418
tz : tzinfo or None
419419
timezone for the timezone-aware output.
420420
reso : NPY_DATETIMEUNIT, default NPY_FR_ns
@@ -463,7 +463,7 @@ cdef _TSObject _create_tsobject_tz_using_offset(npy_datetimestruct dts,
463463
return obj
464464

465465

466-
cdef _TSObject _convert_str_to_tsobject(object ts, tzinfo tz, str unit,
466+
cdef _TSObject _convert_str_to_tsobject(str ts, tzinfo tz, str unit,
467467
bint dayfirst=False,
468468
bint yearfirst=False):
469469
"""
@@ -499,7 +499,6 @@ cdef _TSObject _convert_str_to_tsobject(object ts, tzinfo tz, str unit,
499499
NPY_DATETIMEUNIT out_bestunit, reso
500500

501501
if len(ts) == 0 or ts in nat_strings:
502-
ts = NaT
503502
obj = _TSObject()
504503
obj.value = NPY_NAT
505504
obj.tzinfo = tz
@@ -727,16 +726,16 @@ cdef tzinfo convert_timezone(
727726

728727

729728
cdef int64_t parse_pydatetime(
730-
object val,
731-
npy_datetimestruct *dts,
732-
bint utc_convert,
729+
datetime val,
730+
npy_datetimestruct *dts,
731+
bint utc_convert,
733732
) except? -1:
734733
"""
735734
Convert pydatetime to datetime64.
736735
737736
Parameters
738737
----------
739-
val
738+
val : datetime
740739
Element being processed.
741740
dts : *npy_datetimestruct
742741
Needed to use in pydatetime_to_dt64, which writes to it.

pandas/_libs/tslibs/parsing.pyi

-12
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ def parse_datetime_string(
1111
date_string: str,
1212
dayfirst: bool = ...,
1313
yearfirst: bool = ...,
14-
**kwargs,
1514
) -> datetime: ...
1615
def parse_time_string(
1716
arg: str,
@@ -24,28 +23,17 @@ def quarter_to_myear(year: int, quarter: int, freq: str) -> tuple[int, int]: ...
2423
def try_parse_dates(
2524
values: npt.NDArray[np.object_], # object[:]
2625
parser,
27-
dayfirst: bool = ...,
28-
default: datetime | None = ...,
2926
) -> npt.NDArray[np.object_]: ...
3027
def try_parse_year_month_day(
3128
years: npt.NDArray[np.object_], # object[:]
3229
months: npt.NDArray[np.object_], # object[:]
3330
days: npt.NDArray[np.object_], # object[:]
3431
) -> npt.NDArray[np.object_]: ...
35-
def try_parse_datetime_components(
36-
years: npt.NDArray[np.object_], # object[:]
37-
months: npt.NDArray[np.object_], # object[:]
38-
days: npt.NDArray[np.object_], # object[:]
39-
hours: npt.NDArray[np.object_], # object[:]
40-
minutes: npt.NDArray[np.object_], # object[:]
41-
seconds: npt.NDArray[np.object_], # object[:]
42-
) -> npt.NDArray[np.object_]: ...
4332
def guess_datetime_format(
4433
dt_str,
4534
dayfirst: bool | None = ...,
4635
) -> str | None: ...
4736
def concat_date_cols(
4837
date_cols: tuple,
49-
keep_trivial_numbers: bool = ...,
5038
) -> npt.NDArray[np.object_]: ...
5139
def get_rule_month(source: str) -> str: ...

0 commit comments

Comments
 (0)