From f27d9567424d090c769bf312e9f24ffa35451623 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Sun, 26 Nov 2023 01:07:51 +0100 Subject: [PATCH 1/9] Add 3.12 builds --- .github/workflows/unit-tests.yml | 6 ++- ci/deps/actions-312.yaml | 63 ++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 ci/deps/actions-312.yaml diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 33b6e7a8c2340..b731a5cedb9f1 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -26,7 +26,7 @@ jobs: timeout-minutes: 90 strategy: matrix: - env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml] + env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml, actions-312.yaml] # Prevent the include jobs from overriding other jobs pattern: [""] include: @@ -68,6 +68,10 @@ jobs: - name: "Copy-on-Write 3.11" env_file: actions-311.yaml pattern: "not slow and not network and not single_cpu" + pandas_copy_on_write: + - name: "Copy-on-Write 3.12" + env_file: actions-312.yaml + pattern: "not slow and not network and not single_cpu" pandas_copy_on_write: "1" - name: "Copy-on-Write 3.11 (warnings)" env_file: actions-311.yaml diff --git a/ci/deps/actions-312.yaml b/ci/deps/actions-312.yaml new file mode 100644 index 0000000000000..79ce92a78d803 --- /dev/null +++ b/ci/deps/actions-312.yaml @@ -0,0 +1,63 @@ +name: pandas-dev +channels: + - conda-forge +dependencies: + - python=3.12 + + # build dependencies + - versioneer[toml] + - cython>=0.29.33 + - meson[ninja]=1.2.1 + - meson-python=0.13.1 + + # test dependencies + - pytest>=7.3.2 + - pytest-cov + - pytest-xdist>=2.2.0 + - pytest-localserver>=0.7.1 + - pytest-qt>=4.2.0 + - boto3 + + # required dependencies + - python-dateutil + - numpy<2 + - pytz + + # optional dependencies + - beautifulsoup4>=4.11.2 + - blosc>=1.21.3 + - bottleneck>=1.3.6 + - fastparquet>=2022.12.0 + - fsspec>=2022.11.0 + - html5lib>=1.1 + - hypothesis>=6.46.1 + - gcsfs>=2022.11.0 + - jinja2>=3.1.2 + - lxml>=4.9.2 + - matplotlib>=3.6.3 + - numba>=0.56.4 + - numexpr>=2.8.4 + - odfpy>=1.4.1 + - qtpy>=2.3.0 + - pyqt>=5.15.9 + - openpyxl>=3.1.0 + - psycopg2>=2.9.6 + - pyarrow>=10.0.1 + - pymysql>=1.0.2 + - pyreadstat>=1.2.0 + - pytables>=3.8.0 + - python-calamine>=0.1.6 + - pyxlsb>=1.0.10 + - s3fs>=2022.11.0 + - scipy>=1.10.0 + - sqlalchemy>=2.0.0 + - tabulate>=0.9.0 + - xarray>=2022.12.0 + - xlrd>=2.0.1 + - xlsxwriter>=3.0.5 + - zstandard>=0.19.0 + + - pip: + - adbc-driver-postgresql>=0.8.0 + - adbc-driver-sqlite>=0.8.0 + - tzdata>=2022.7 From e609166edfd2aaac5a2d8015520b85c45e2c0a86 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Sun, 26 Nov 2023 01:08:49 +0100 Subject: [PATCH 2/9] Fix --- .github/workflows/unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index b731a5cedb9f1..58b7974e35565 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -68,7 +68,7 @@ jobs: - name: "Copy-on-Write 3.11" env_file: actions-311.yaml pattern: "not slow and not network and not single_cpu" - pandas_copy_on_write: + pandas_copy_on_write: "1" - name: "Copy-on-Write 3.12" env_file: actions-312.yaml pattern: "not slow and not network and not single_cpu" From 69a523b4447a930b4c249802c07ece58d38512dd Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Sun, 26 Nov 2023 01:11:48 +0100 Subject: [PATCH 3/9] Fix --- ci/deps/actions-312.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/deps/actions-312.yaml b/ci/deps/actions-312.yaml index 79ce92a78d803..b856295fbec04 100644 --- a/ci/deps/actions-312.yaml +++ b/ci/deps/actions-312.yaml @@ -46,7 +46,6 @@ dependencies: - pymysql>=1.0.2 - pyreadstat>=1.2.0 - pytables>=3.8.0 - - python-calamine>=0.1.6 - pyxlsb>=1.0.10 - s3fs>=2022.11.0 - scipy>=1.10.0 From c7fb666ca2b64fd16316058c5faf7c1f690877a2 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Sun, 26 Nov 2023 01:15:16 +0100 Subject: [PATCH 4/9] Fix --- ci/deps/actions-312.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ci/deps/actions-312.yaml b/ci/deps/actions-312.yaml index b856295fbec04..aef5691f38226 100644 --- a/ci/deps/actions-312.yaml +++ b/ci/deps/actions-312.yaml @@ -1,4 +1,4 @@ -name: pandas-dev +name: pandas-dev-312 channels: - conda-forge dependencies: @@ -35,7 +35,7 @@ dependencies: - jinja2>=3.1.2 - lxml>=4.9.2 - matplotlib>=3.6.3 - - numba>=0.56.4 + # - numba>=0.56.4 - numexpr>=2.8.4 - odfpy>=1.4.1 - qtpy>=2.3.0 @@ -46,6 +46,7 @@ dependencies: - pymysql>=1.0.2 - pyreadstat>=1.2.0 - pytables>=3.8.0 + # - python-calamine>=0.1.6 - pyxlsb>=1.0.10 - s3fs>=2022.11.0 - scipy>=1.10.0 From 02ed106aaaf83d3da2726b27fc2172ac8b8e0781 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Sun, 26 Nov 2023 01:16:58 +0100 Subject: [PATCH 5/9] Fix --- .github/workflows/unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 58b7974e35565..d5f4338fad8ac 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -186,7 +186,7 @@ jobs: strategy: matrix: os: [macos-latest, windows-latest] - env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml] + env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml, actions-312.yaml] fail-fast: false runs-on: ${{ matrix.os }} name: ${{ format('{0} {1}', matrix.os, matrix.env_file) }} From 3ce3f6bdbe3254ed21ce821fb0137662cb34e370 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Sun, 26 Nov 2023 12:23:09 +0100 Subject: [PATCH 6/9] Fix tests --- pandas/tests/computation/test_eval.py | 13 +++++++++++-- pandas/tests/extension/test_arrow.py | 9 ++++++++- pandas/tests/io/excel/test_readers.py | 4 +++- pandas/tests/io/excel/test_writers.py | 4 +++- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/pandas/tests/computation/test_eval.py b/pandas/tests/computation/test_eval.py index fe49446424de1..ee2c53895ff4d 100644 --- a/pandas/tests/computation/test_eval.py +++ b/pandas/tests/computation/test_eval.py @@ -542,6 +542,9 @@ def test_series_pos(self, lhs, engine, parser): def test_scalar_unary(self, engine, parser): msg = "bad operand type for unary ~: 'float'" + warn = None + if PY312 and not (engine == "numexpr" and parser == "pandas"): + warn = DeprecationWarning with pytest.raises(TypeError, match=msg): pd.eval("~1.0", engine=engine, parser=parser) @@ -550,8 +553,14 @@ def test_scalar_unary(self, engine, parser): assert pd.eval("~1", parser=parser, engine=engine) == ~1 assert pd.eval("-1", parser=parser, engine=engine) == -1 assert pd.eval("+1", parser=parser, engine=engine) == +1 - assert pd.eval("~True", parser=parser, engine=engine) == ~True - assert pd.eval("~False", parser=parser, engine=engine) == ~False + with tm.assert_produces_warning( + warn, match="Bitwise inversion", check_stacklevel=False + ): + assert pd.eval("~True", parser=parser, engine=engine) == ~True + with tm.assert_produces_warning( + warn, match="Bitwise inversion", check_stacklevel=False + ): + assert pd.eval("~False", parser=parser, engine=engine) == ~False assert pd.eval("-True", parser=parser, engine=engine) == -True assert pd.eval("-False", parser=parser, engine=engine) == -False assert pd.eval("+True", parser=parser, engine=engine) == +True diff --git a/pandas/tests/extension/test_arrow.py b/pandas/tests/extension/test_arrow.py index 8298d39a5eca9..7131a50956a7d 100644 --- a/pandas/tests/extension/test_arrow.py +++ b/pandas/tests/extension/test_arrow.py @@ -34,6 +34,7 @@ from pandas._libs.tslibs import timezones from pandas.compat import ( PY311, + PY312, is_ci_environment, is_platform_windows, pa_version_under11p0, @@ -716,7 +717,13 @@ def test_invert(self, data, request): reason=f"pyarrow.compute.invert does support {pa_dtype}", ) ) - super().test_invert(data) + if PY312 and pa.types.is_boolean(pa_dtype): + with tm.assert_produces_warning( + DeprecationWarning, match="Bitwise inversion", check_stacklevel=False + ): + super().test_invert(data) + else: + super().test_invert(data) @pytest.mark.parametrize("periods", [1, -2]) def test_diff(self, data, periods, request): diff --git a/pandas/tests/io/excel/test_readers.py b/pandas/tests/io/excel/test_readers.py index abbdb77efad0e..d9148459af419 100644 --- a/pandas/tests/io/excel/test_readers.py +++ b/pandas/tests/io/excel/test_readers.py @@ -1437,7 +1437,9 @@ def test_deprecate_bytes_input(self, engine, read_ext): "byte string, wrap it in a `BytesIO` object." ) - with tm.assert_produces_warning(FutureWarning, match=msg): + with tm.assert_produces_warning( + FutureWarning, match=msg, raise_on_extra_warnings=False + ): with open("test1" + read_ext, "rb") as f: pd.read_excel(f.read(), engine=engine) diff --git a/pandas/tests/io/excel/test_writers.py b/pandas/tests/io/excel/test_writers.py index 22cd0621fd4c4..7a1c0631d4101 100644 --- a/pandas/tests/io/excel/test_writers.py +++ b/pandas/tests/io/excel/test_writers.py @@ -287,7 +287,9 @@ def test_read_excel_parse_dates(self, ext): date_parser = lambda x: datetime.strptime(x, "%m/%d/%Y") with tm.assert_produces_warning( - FutureWarning, match="use 'date_format' instead" + FutureWarning, + match="use 'date_format' instead", + raise_on_extra_warnings=False, ): res = pd.read_excel( pth, From f58ad20d67cb5c06ceac5f7b77b2b381229323fa Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Sun, 26 Nov 2023 14:17:01 +0100 Subject: [PATCH 7/9] Fix --- ci/deps/actions-312.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/deps/actions-312.yaml b/ci/deps/actions-312.yaml index aef5691f38226..fca9dd03eb4fc 100644 --- a/ci/deps/actions-312.yaml +++ b/ci/deps/actions-312.yaml @@ -45,7 +45,7 @@ dependencies: - pyarrow>=10.0.1 - pymysql>=1.0.2 - pyreadstat>=1.2.0 - - pytables>=3.8.0 + # ∆- pytables>=3.8.0 # - python-calamine>=0.1.6 - pyxlsb>=1.0.10 - s3fs>=2022.11.0 From f2f71d1b97f134ff1bdbd3a860843a9f214c5bcd Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Tue, 28 Nov 2023 16:53:46 +0100 Subject: [PATCH 8/9] Update ci/deps/actions-312.yaml Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> --- ci/deps/actions-312.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/deps/actions-312.yaml b/ci/deps/actions-312.yaml index fca9dd03eb4fc..394b65525c791 100644 --- a/ci/deps/actions-312.yaml +++ b/ci/deps/actions-312.yaml @@ -45,7 +45,7 @@ dependencies: - pyarrow>=10.0.1 - pymysql>=1.0.2 - pyreadstat>=1.2.0 - # ∆- pytables>=3.8.0 + # - pytables>=3.8.0 # - python-calamine>=0.1.6 - pyxlsb>=1.0.10 - s3fs>=2022.11.0 From 37db2075e810e0efceee2da9677e5e3dee388868 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Wed, 29 Nov 2023 22:15:11 +0100 Subject: [PATCH 9/9] Disable dev --- .github/workflows/unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 0f5eb7ec06d8b..30397632a0af6 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -325,7 +325,7 @@ jobs: # To freeze this file, uncomment out the ``if: false`` condition, and migrate the jobs # to the corresponding posix/windows-macos/sdist etc. workflows. # Feel free to modify this comment as necessary. - #if: false # Uncomment this to freeze the workflow, comment it to unfreeze + if: false # Uncomment this to freeze the workflow, comment it to unfreeze defaults: run: shell: bash -eou pipefail {0}