From e2a2321f960d8c2446f2e09d7151de31221d6e88 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Fri, 5 Aug 2022 15:09:17 +0200 Subject: [PATCH 1/5] DEPS: Update cython --- environment.yml | 2 +- requirements-dev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/environment.yml b/environment.yml index ec2e0a3860432..7b4c537c0bcd9 100644 --- a/environment.yml +++ b/environment.yml @@ -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/requirements-dev.txt b/requirements-dev.txt index 5a9647456cb0b..7c7271bb2d8b7 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # This file is auto-generated from environment.yml, do not modify. # See that file for comments about the need/usage of each dependency. -cython==0.29.30 +cython==0.29.32 pytest>=6.0 pytest-cov pytest-xdist>=1.31 From fcbdf71839445006229f0f539997b0427c07f168 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Fri, 5 Aug 2022 15:10:43 +0200 Subject: [PATCH 2/5] Update for benchmarks --- asv_bench/asv.conf.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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": [], From 10052b54a72e40da0b0347e4547c299bb80e408d Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Fri, 5 Aug 2022 21:00:25 +0200 Subject: [PATCH 3/5] Adress comments --- 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 ++- pandas/tests/frame/indexing/test_indexing.py | 7 +++++++ setup.py | 2 +- 10 files changed, 17 insertions(+), 9 deletions(-) diff --git a/ci/deps/actions-310.yaml b/ci/deps/actions-310.yaml index 65918005ad6f1..6a2f8b4682043 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 f89d4a743a6f1..9c38f81de3f96 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 a57c7279e2e9b..365be2d54d24d 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 a4473f5911903..5b55bf7454030 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 8605a9f4520d7..46705ca428705 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 e76b3071bd8bb..1c614729331e2 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 a49772fb83ca7..2a50c088837c4 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 setting ``None`` or non-string value into a ``string``-dtype Series using a mask (:issue:`47628`) @@ -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/pandas/tests/frame/indexing/test_indexing.py b/pandas/tests/frame/indexing/test_indexing.py index 24d7365b52159..2849d266db40e 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/setup.py b/setup.py index 70adbd3c083af..12e8aa36c3794 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 987fe9414fcba2dd0ef22b376b3df0e9e4c09c1a Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Fri, 5 Aug 2022 22:35:40 +0200 Subject: [PATCH 4/5] Fix whatsnew --- doc/source/whatsnew/v1.4.4.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v1.4.4.rst b/doc/source/whatsnew/v1.4.4.rst index 2a50c088837c4..8fc36cb0c8543 100644 --- a/doc/source/whatsnew/v1.4.4.rst +++ b/doc/source/whatsnew/v1.4.4.rst @@ -14,7 +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 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 setting ``None`` or non-string value into a ``string``-dtype Series using a mask (:issue:`47628`) From 3568dc265428e0b3d15199ee986462cf786636b4 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Sun, 7 Aug 2022 00:22:53 +0200 Subject: [PATCH 5/5] Update pyproject --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6ca37581b03f0..67c56123a847c 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.