diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 91c30c4c0b333..ac83f50578573 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -103,7 +103,7 @@ jobs: services: mysql: - image: mysql + image: mysql:8.0.33 env: MYSQL_ALLOW_EMPTY_PASSWORD: yes MYSQL_DATABASE: pandas @@ -116,8 +116,9 @@ jobs: - 3306:3306 postgres: - image: postgres + image: postgres:13 env: + PGUSER: postgres POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: pandas @@ -130,7 +131,7 @@ jobs: - 5432:5432 moto: - image: motoserver/moto:4.1.12 + image: motoserver/moto:4.1.13 env: AWS_ACCESS_KEY_ID: foobar_key AWS_SECRET_ACCESS_KEY: foobar_secret @@ -237,7 +238,7 @@ jobs: run: | /opt/python/cp311-cp311/bin/python -m venv ~/virtualenvs/pandas-dev . ~/virtualenvs/pandas-dev/bin/activate - python -m pip install -U pip wheel setuptools meson[ninja]==1.0.1 meson-python==0.13.1 + python -m pip install --no-cache-dir -U pip wheel setuptools meson[ninja]==1.0.1 meson-python==0.13.1 python -m pip install --no-cache-dir versioneer[toml] cython numpy python-dateutil pytz pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-asyncio>=0.17 hypothesis>=6.46.1 python -m pip install --no-cache-dir --no-build-isolation -e . python -m pip list --no-cache-dir @@ -275,7 +276,7 @@ jobs: run: | /opt/python/cp311-cp311/bin/python -m venv ~/virtualenvs/pandas-dev . ~/virtualenvs/pandas-dev/bin/activate - python -m pip install -U pip wheel setuptools meson-python==0.13.1 meson[ninja]==1.0.1 + python -m pip install --no-cache-dir -U pip wheel setuptools meson-python==0.13.1 meson[ninja]==1.0.1 python -m pip install --no-cache-dir versioneer[toml] cython numpy python-dateutil pytz pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-asyncio>=0.17 hypothesis>=6.46.1 python -m pip install --no-cache-dir --no-build-isolation -e . python -m pip list --no-cache-dir diff --git a/ci/meta.yaml b/ci/meta.yaml index 09ae0d7253bf7..77f536a18a204 100644 --- a/ci/meta.yaml +++ b/ci/meta.yaml @@ -34,7 +34,8 @@ requirements: - tomli # [py<311] run: - python - - {{ pin_compatible('numpy') }} + - numpy >=1.21.6 # [py<311] + - numpy >=1.23.2 # [py>=311] - python-dateutil >=2.8.2 - pytz >=2020.1 - python-tzdata >=2022.1 diff --git a/pandas/tests/arrays/sparse/test_unary.py b/pandas/tests/arrays/sparse/test_unary.py index 605023a407a06..c00a73773fdd4 100644 --- a/pandas/tests/arrays/sparse/test_unary.py +++ b/pandas/tests/arrays/sparse/test_unary.py @@ -8,6 +8,7 @@ from pandas.core.arrays import SparseArray +@pytest.mark.filterwarnings("ignore:invalid value encountered in cast:RuntimeWarning") @pytest.mark.parametrize("fill_value", [0, np.nan]) @pytest.mark.parametrize("op", [operator.pos, operator.neg]) def test_unary_op(op, fill_value): @@ -36,6 +37,9 @@ def test_invert(fill_value): class TestUnaryMethods: + @pytest.mark.filterwarnings( + "ignore:invalid value encountered in cast:RuntimeWarning" + ) def test_neg_operator(self): arr = SparseArray([-1, -2, np.nan, 3], fill_value=np.nan, dtype=np.int8) res = -arr @@ -47,6 +51,9 @@ def test_neg_operator(self): exp = SparseArray([1, 2, -1, -3], fill_value=1, dtype=np.int8) tm.assert_sp_array_equal(exp, res) + @pytest.mark.filterwarnings( + "ignore:invalid value encountered in cast:RuntimeWarning" + ) def test_abs_operator(self): arr = SparseArray([-1, -2, np.nan, 3], fill_value=np.nan, dtype=np.int8) res = abs(arr) diff --git a/pandas/tests/extension/test_boolean.py b/pandas/tests/extension/test_boolean.py index 63ae2b629e549..7c27f105b9b45 100644 --- a/pandas/tests/extension/test_boolean.py +++ b/pandas/tests/extension/test_boolean.py @@ -26,6 +26,13 @@ from pandas.core.arrays.boolean import BooleanDtype from pandas.tests.extension import base +pytestmark = [ + pytest.mark.filterwarnings( + "ignore:invalid value encountered in divide:RuntimeWarning" + ), + pytest.mark.filterwarnings("ignore:Mean of empty slice:RuntimeWarning"), +] + def make_data(): return [True, False] * 4 + [np.nan] + [True, False] * 44 + [np.nan] + [True, False] diff --git a/pandas/tests/extension/test_floating.py b/pandas/tests/extension/test_floating.py index 5ac90bf17ddc9..d337b91be34bb 100644 --- a/pandas/tests/extension/test_floating.py +++ b/pandas/tests/extension/test_floating.py @@ -30,6 +30,14 @@ masked_shared, ) +pytestmark = [ + pytest.mark.filterwarnings("ignore:overflow encountered in reduce:RuntimeWarning"), + pytest.mark.filterwarnings( + "ignore:invalid value encountered in divide:RuntimeWarning" + ), + pytest.mark.filterwarnings("ignore:Mean of empty slice:RuntimeWarning"), +] + def make_data(): return ( diff --git a/pandas/tests/extension/test_integer.py b/pandas/tests/extension/test_integer.py index c638977b959a7..448f70d54e61e 100644 --- a/pandas/tests/extension/test_integer.py +++ b/pandas/tests/extension/test_integer.py @@ -37,6 +37,13 @@ masked_shared, ) +pytestmark = [ + pytest.mark.filterwarnings( + "ignore:invalid value encountered in divide:RuntimeWarning" + ), + pytest.mark.filterwarnings("ignore:Mean of empty slice:RuntimeWarning"), +] + def make_data(): return list(range(1, 9)) + [pd.NA] + list(range(10, 98)) + [pd.NA] + [99, 100] diff --git a/pandas/tests/groupby/test_groupby.py b/pandas/tests/groupby/test_groupby.py index 635416f0cb1d6..c8de1cd6785b6 100644 --- a/pandas/tests/groupby/test_groupby.py +++ b/pandas/tests/groupby/test_groupby.py @@ -30,6 +30,8 @@ import pandas.core.common as com from pandas.tests.groupby import get_groupby_method_args +pytestmark = pytest.mark.filterwarnings("ignore:Mean of empty slice:RuntimeWarning") + def test_repr(): # GH18203 diff --git a/pandas/tests/series/methods/test_describe.py b/pandas/tests/series/methods/test_describe.py index 7f706fc54897e..79ec11feb5308 100644 --- a/pandas/tests/series/methods/test_describe.py +++ b/pandas/tests/series/methods/test_describe.py @@ -158,6 +158,7 @@ def test_datetime_is_numeric_includes_datetime(self): ) tm.assert_series_equal(result, expected) + @pytest.mark.filterwarnings("ignore:Casting complex values to real discards") def test_numeric_result_dtype(self, any_numeric_dtype): # GH#48340 - describe should always return float on non-complex numeric input if is_extension_array_dtype(any_numeric_dtype):