From 7c3ceb588e74fbb27aacd78e17c58fa42f423840 Mon Sep 17 00:00:00 2001 From: Simon Hawkins Date: Mon, 8 Aug 2022 20:11:20 +0100 Subject: [PATCH 1/2] Backport PR #47979: DEPS: Update cython --- asv_bench/asv.conf.json | 2 +- ci/deps/actions-310.yaml | 2 +- ci/deps/actions-38-downstream_compat.yaml | 2 +- ci/deps/actions-38-minimum_versions.yaml | 2 +- ci/deps/actions-38.yaml | 2 +- ci/deps/actions-39.yaml | 2 +- ci/deps/actions-pypy-38.yaml | 2 +- ci/deps/circle-38-arm64.yaml | 2 +- doc/source/whatsnew/v1.4.4.rst | 3 ++- environment.yml | 2 +- pandas/tests/frame/indexing/test_indexing.py | 7 +++++++ pyproject.toml | 2 +- requirements-dev.txt | 2 +- setup.py | 2 +- 14 files changed, 21 insertions(+), 13 deletions(-) diff --git a/asv_bench/asv.conf.json b/asv_bench/asv.conf.json index 46640505a4c84..b1ea2682b7ea7 100644 --- a/asv_bench/asv.conf.json +++ b/asv_bench/asv.conf.json @@ -42,7 +42,7 @@ // followed by the pip installed packages). "matrix": { "numpy": [], - "Cython": ["0.29.30"], + "Cython": ["0.29.32"], "matplotlib": [], "sqlalchemy": [], "scipy": [], diff --git a/ci/deps/actions-310.yaml b/ci/deps/actions-310.yaml index 7a879b5ac9648..df1dfdd38542c 100644 --- a/ci/deps/actions-310.yaml +++ b/ci/deps/actions-310.yaml @@ -5,7 +5,7 @@ dependencies: - python=3.10 # test dependencies - - cython=0.29.30 + - cython>=0.29.32 - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 diff --git a/ci/deps/actions-38-downstream_compat.yaml b/ci/deps/actions-38-downstream_compat.yaml index cd501b1e018ef..89a54a857a0a8 100644 --- a/ci/deps/actions-38-downstream_compat.yaml +++ b/ci/deps/actions-38-downstream_compat.yaml @@ -6,7 +6,7 @@ dependencies: - python=3.8 # test dependencies - - cython=0.29.30 + - cython>=0.29.32 - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 diff --git a/ci/deps/actions-38-minimum_versions.yaml b/ci/deps/actions-38-minimum_versions.yaml index f6c3f3855aa02..ab0e46feecd33 100644 --- a/ci/deps/actions-38-minimum_versions.yaml +++ b/ci/deps/actions-38-minimum_versions.yaml @@ -7,7 +7,7 @@ dependencies: - python=3.8.0 # test dependencies - - cython=0.29.30 + - cython>=0.29.32 - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 diff --git a/ci/deps/actions-38.yaml b/ci/deps/actions-38.yaml index 4d2ffbfbd9ce5..4feff3100d78f 100644 --- a/ci/deps/actions-38.yaml +++ b/ci/deps/actions-38.yaml @@ -5,7 +5,7 @@ dependencies: - python=3.8 # test dependencies - - cython=0.29.30 + - cython>=0.29.32 - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 diff --git a/ci/deps/actions-39.yaml b/ci/deps/actions-39.yaml index 202db035a6c52..0ba1dc7f4deb1 100644 --- a/ci/deps/actions-39.yaml +++ b/ci/deps/actions-39.yaml @@ -5,7 +5,7 @@ dependencies: - python=3.9 # test dependencies - - cython=0.29.30 + - cython>=0.29.32 - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 diff --git a/ci/deps/actions-pypy-38.yaml b/ci/deps/actions-pypy-38.yaml index 1a3c73cb4ae2f..e06b992acc191 100644 --- a/ci/deps/actions-pypy-38.yaml +++ b/ci/deps/actions-pypy-38.yaml @@ -8,7 +8,7 @@ dependencies: - python=3.8[build=*_pypy] # TODO: use this once pypy3.8 is available # tools - - cython>=0.29.30 + - cython>=0.29.32 - pytest>=6.0 - pytest-cov - pytest-asyncio diff --git a/ci/deps/circle-38-arm64.yaml b/ci/deps/circle-38-arm64.yaml index 5d3f79602ed37..221887e58d071 100644 --- a/ci/deps/circle-38-arm64.yaml +++ b/ci/deps/circle-38-arm64.yaml @@ -5,7 +5,7 @@ dependencies: - python=3.8 # test dependencies - - cython=0.29.30 + - cython>=0.29.32 - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 diff --git a/doc/source/whatsnew/v1.4.4.rst b/doc/source/whatsnew/v1.4.4.rst index b4224b5b210e0..57b8fdee5888a 100644 --- a/doc/source/whatsnew/v1.4.4.rst +++ b/doc/source/whatsnew/v1.4.4.rst @@ -14,6 +14,7 @@ including other versions of pandas. Fixed regressions ~~~~~~~~~~~~~~~~~ +- Fixed regression in taking NULL :class:`objects` from a :class:`DataFrame` causing a segmentation violation. These NULL values are created by :meth:`numpy.empty_like` (:issue:`46848`) - Fixed regression in :func:`concat` materializing :class:`Index` during sorting even if :class:`Index` was already sorted (:issue:`47501`) - Fixed regression in :meth:`DataFrame.loc` not updating the cache correctly after values were set (:issue:`47867`) - Fixed regression in :meth:`DataFrame.loc` not aligning index in some cases when setting a :class:`DataFrame` (:issue:`47578`) @@ -36,7 +37,7 @@ Bug fixes Other ~~~~~ -- +- The minimum version of Cython needed to compile pandas is now ``0.29.32`` (:issue:`47978`) - .. --------------------------------------------------------------------------- diff --git a/environment.yml b/environment.yml index a20ccc797eb79..90057bd5d62b5 100644 --- a/environment.yml +++ b/environment.yml @@ -15,7 +15,7 @@ dependencies: # The compiler packages are meta-packages and install the correct compiler (activation) packages on the respective platforms. - c-compiler - cxx-compiler - - cython>=0.29.30 + - cython=0.29.32 # code checks - black=22.3.0 diff --git a/pandas/tests/frame/indexing/test_indexing.py b/pandas/tests/frame/indexing/test_indexing.py index 4dc9cbdb7b34d..acb825c53155f 100644 --- a/pandas/tests/frame/indexing/test_indexing.py +++ b/pandas/tests/frame/indexing/test_indexing.py @@ -1227,6 +1227,13 @@ def test_iloc_setitem_nullable_2d_values(self): df.iloc[:] = df.iloc[:, :] tm.assert_frame_equal(df, orig) + def test_getitem_segfault_with_empty_like_object(self): + # GH#46848 + df = DataFrame(np.empty((1, 1), dtype=object)) + df[0] = np.empty_like(df[0]) + # this produces the segfault + df[[0]] + @pytest.mark.parametrize( "null", [pd.NaT, pd.NaT.to_numpy("M8[ns]"), pd.NaT.to_numpy("m8[ns]")] ) diff --git a/pyproject.toml b/pyproject.toml index 318a7398e1035..93dd13476e936 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ requires = [ "setuptools>=51.0.0", "wheel", - "Cython>=0.29.24,<3", # Note: sync with setup.py, environment.yml and asv.conf.json + "Cython>=0.29.32,<3", # Note: sync with setup.py, environment.yml and asv.conf.json "oldest-supported-numpy>=0.10" ] # uncomment to enable pep517 after versioneer problem is fixed. diff --git a/requirements-dev.txt b/requirements-dev.txt index aba5a3b5a23d5..e2b4c73f4a843 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,7 +5,7 @@ numpy>=1.18.5, <=1.22.4 python-dateutil>=2.8.1 pytz asv -cython>=0.29.30 +cython==0.29.32 black==22.3.0 cpplint flake8==4.0.1 diff --git a/setup.py b/setup.py index ec3fa3c0433f4..5c3531c7d969c 100755 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ def is_platform_mac(): # note: sync with pyproject.toml, environment.yml and asv.conf.json -min_cython_ver = "0.29.30" +min_cython_ver = "0.29.32" try: from Cython import ( From 53784571b009d8f66e298bcfd6d116d0935f2ac0 Mon Sep 17 00:00:00 2001 From: Simon Hawkins Date: Mon, 8 Aug 2022 20:16:57 +0100 Subject: [PATCH 2/2] missed one --- ci/deps/actions-310-numpydev.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/deps/actions-310-numpydev.yaml b/ci/deps/actions-310-numpydev.yaml index 2ac97cc479196..90f3483d03dff 100644 --- a/ci/deps/actions-310-numpydev.yaml +++ b/ci/deps/actions-310-numpydev.yaml @@ -16,7 +16,7 @@ dependencies: - pytz - pip - pip: - - cython==0.29.30 # GH#34014 + - cython==0.29.32 - "--extra-index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple" - "--pre" - "numpy"