From 98bc2fbe15dc5171c0555382e2ca0a0f42166643 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Mon, 11 Mar 2024 12:56:31 -0700 Subject: [PATCH 1/4] CI: Fail tests on all FutureWarning/DeprecationWarning --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index bbcaa73b55ff8..0fe463687e635 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -482,6 +482,8 @@ doctest_optionflags = [ ] filterwarnings = [ "error:::pandas", + "error::FutureWarning", + "error::DeprecationWarning", "error::ResourceWarning", "error::pytest.PytestUnraisableExceptionWarning", # TODO(PY311-minimum): Specify EncodingWarning @@ -500,6 +502,8 @@ filterwarnings = [ "ignore:Setuptools is replacing distutils.:UserWarning:_distutils_hack", # https://github.com/PyTables/PyTables/issues/822 "ignore:a closed node found in the registry:UserWarning:tables", + # https://github.com/pytest-dev/pytest-cov/issues/557 + "ignore:The --rsyncdir command line argument:DeprecationWarning:xdist" ] junit_family = "xunit2" markers = [ From 02f97243d4be0f3c1a95322dc7eebbc404ed0157 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Mon, 11 Mar 2024 12:57:27 -0700 Subject: [PATCH 2/4] CI: Fail tests on all FutureWarning/DeprecationWarning --- .github/workflows/unit-tests.yml | 3 --- ci/run_tests.sh | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 855973a22886a..70afe39bd15ea 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -60,11 +60,9 @@ jobs: - name: "Pypy" env_file: actions-pypy-39.yaml pattern: "not slow and not network and not single_cpu" - test_args: "--max-worker-restart 0" - name: "Numpy Dev" env_file: actions-311-numpydev.yaml pattern: "not slow and not network and not single_cpu" - test_args: "-W error::DeprecationWarning -W error::FutureWarning" - name: "Pyarrow Nightly" env_file: actions-311-pyarrownightly.yaml pattern: "not slow and not network and not single_cpu" @@ -83,7 +81,6 @@ jobs: LANG: ${{ matrix.lang || 'C.UTF-8' }} LC_ALL: ${{ matrix.lc_all || '' }} PANDAS_CI: ${{ matrix.pandas_ci || '1' }} - TEST_ARGS: ${{ matrix.test_args || '' }} PYTEST_WORKERS: ${{ matrix.pytest_workers || 'auto' }} PYTEST_TARGET: ${{ matrix.pytest_target || 'pandas' }} NPY_PROMOTION_STATE: ${{ matrix.env_file == 'actions-311-numpydev.yaml' && 'weak' || 'legacy' }} diff --git a/ci/run_tests.sh b/ci/run_tests.sh index 39ab0890a32d1..b6ff50bd14475 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -10,7 +10,7 @@ echo PYTHONHASHSEED=$PYTHONHASHSEED COVERAGE="-s --cov=pandas --cov-report=xml --cov-append --cov-config=pyproject.toml" -PYTEST_CMD="MESONPY_EDITABLE_VERBOSE=1 PYTHONDEVMODE=1 PYTHONWARNDEFAULTENCODING=1 pytest -r fE -n $PYTEST_WORKERS --dist=loadfile $TEST_ARGS $COVERAGE $PYTEST_TARGET" +PYTEST_CMD="MESONPY_EDITABLE_VERBOSE=1 PYTHONDEVMODE=1 PYTHONWARNDEFAULTENCODING=1 pytest -r fE -n $PYTEST_WORKERS --dist=loadfile $COVERAGE $PYTEST_TARGET" if [[ "$PATTERN" ]]; then PYTEST_CMD="$PYTEST_CMD -m \"$PATTERN\"" From 0c79b81cf5c1431ccf0f435f1faf8de2237d7fa9 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Mon, 11 Mar 2024 14:48:23 -0700 Subject: [PATCH 3/4] Ignore fastparquet warning --- pandas/tests/io/test_parquet.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index 55be48eb572fd..19490020fcd0e 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1142,6 +1142,7 @@ def test_duplicate_columns(self, fp): msg = "Cannot create parquet dataset with duplicate column names" self.check_error_on_write(df, fp, ValueError, msg) + @pytest.mark.filterwarnings("ignore:The copy keyword is:DeprecationWarning") def test_bool_with_none(self, fp): df = pd.DataFrame({"a": [True, None, False]}) expected = pd.DataFrame({"a": [1.0, np.nan, 0.0]}, dtype="float16") From a8425e46b6cc9ade6243186df36c3b10fbaf8b4c Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Mon, 11 Mar 2024 15:29:01 -0700 Subject: [PATCH 4/4] only pyarrow and numpy --- pandas/tests/io/test_parquet.py | 1 - pyproject.toml | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index 19490020fcd0e..55be48eb572fd 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -1142,7 +1142,6 @@ def test_duplicate_columns(self, fp): msg = "Cannot create parquet dataset with duplicate column names" self.check_error_on_write(df, fp, ValueError, msg) - @pytest.mark.filterwarnings("ignore:The copy keyword is:DeprecationWarning") def test_bool_with_none(self, fp): df = pd.DataFrame({"a": [True, None, False]}) expected = pd.DataFrame({"a": [1.0, np.nan, 0.0]}, dtype="float16") diff --git a/pyproject.toml b/pyproject.toml index 0fe463687e635..a226197891a4f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -482,8 +482,10 @@ doctest_optionflags = [ ] filterwarnings = [ "error:::pandas", - "error::FutureWarning", - "error::DeprecationWarning", + "error::FutureWarning:numpy", + "error::DeprecationWarning:numpy", + "error::FutureWarning:pyarrow", + "error::DeprecationWarning:pyarrow", "error::ResourceWarning", "error::pytest.PytestUnraisableExceptionWarning", # TODO(PY311-minimum): Specify EncodingWarning @@ -502,8 +504,6 @@ filterwarnings = [ "ignore:Setuptools is replacing distutils.:UserWarning:_distutils_hack", # https://github.com/PyTables/PyTables/issues/822 "ignore:a closed node found in the registry:UserWarning:tables", - # https://github.com/pytest-dev/pytest-cov/issues/557 - "ignore:The --rsyncdir command line argument:DeprecationWarning:xdist" ] junit_family = "xunit2" markers = [