From 749872f713fa26e624b007adf27dffec83761d96 Mon Sep 17 00:00:00 2001 From: Simon Hawkins Date: Tue, 29 Mar 2022 23:40:54 +0100 Subject: [PATCH] Backport of CI related PRs on 1.4.x (#46559) --- .circleci/config.yml | 2 +- .github/workflows/posix.yml | 3 +- azure-pipelines.yml | 2 +- ci/deps/actions-310-numpydev.yaml | 1 + ci/deps/actions-310.yaml | 4 ++ ci/deps/actions-38-downstream_compat.yaml | 11 ++--- ci/deps/actions-38-minimum_versions.yaml | 8 +++- ci/deps/actions-38.yaml | 8 +++- ci/deps/actions-39.yaml | 6 ++- ci/deps/circle-38-arm64.yaml | 50 ++++++++++++++++++---- doc/source/getting_started/install.rst | 4 +- environment.yml | 2 +- pandas/compat/_optional.py | 17 ++++++-- pandas/tests/arrays/string_/test_string.py | 2 +- pandas/tests/extension/arrow/test_bool.py | 9 ++++ pandas/tests/extension/base/ops.py | 17 +++++--- pandas/tests/extension/json/test_json.py | 21 +++++++-- pandas/tests/extension/test_categorical.py | 18 ++------ pandas/tests/extension/test_datetime.py | 4 +- pandas/tests/extension/test_interval.py | 24 ++++++----- pandas/tests/extension/test_numpy.py | 18 ++++---- pandas/tests/extension/test_string.py | 6 +-- pandas/tests/plotting/frame/test_frame.py | 7 ++- pandas/tests/plotting/test_converter.py | 2 +- pyproject.toml | 1 + requirements-dev.txt | 2 +- 26 files changed, 165 insertions(+), 84 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dc357101e79fd..9d1a11026b35d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ jobs: environment: ENV_FILE: ci/deps/circle-38-arm64.yaml PYTEST_WORKERS: auto - PATTERN: "not slow and not network and not clipboard and not arm_slow" + PATTERN: "not single_cpu and not slow and not network and not clipboard and not arm_slow and not db" PYTEST_TARGET: "pandas" steps: - checkout diff --git a/.github/workflows/posix.yml b/.github/workflows/posix.yml index 303d58d96c2c7..0d5ef807a3392 100644 --- a/.github/workflows/posix.yml +++ b/.github/workflows/posix.yml @@ -162,8 +162,7 @@ jobs: shell: bash run: | # TODO: re-enable cov, its slowing the tests down though - # TODO: Unpin Cython, the new Cython 0.29.26 is causing compilation errors - pip install Cython==0.29.25 numpy python-dateutil pytz pytest>=6.0 pytest-xdist>=1.31.0 hypothesis>=5.5.3 + pip install Cython numpy python-dateutil pytz pytest>=6.0 pytest-xdist>=1.31.0 pytest-asyncio>=0.17 hypothesis>=5.5.3 if: ${{ env.IS_PYPY == 'true' }} - name: Build Pandas diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a37ea3eb89167..ec798bd607034 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -45,7 +45,7 @@ jobs: /opt/python/cp38-cp38/bin/python -m venv ~/virtualenvs/pandas-dev && \ . ~/virtualenvs/pandas-dev/bin/activate && \ python -m pip install --no-deps -U pip wheel 'setuptools<60.0.0' && \ - pip install cython numpy python-dateutil pytz pytest pytest-xdist hypothesis pytest-azurepipelines && \ + pip install cython numpy python-dateutil pytz pytest pytest-xdist pytest-asyncio>=0.17 hypothesis && \ python setup.py build_ext -q -j2 && \ python -m pip install --no-build-isolation -e . && \ pytest -m 'not slow and not network and not clipboard' pandas --junitxml=test-data.xml" diff --git a/ci/deps/actions-310-numpydev.yaml b/ci/deps/actions-310-numpydev.yaml index 3e32665d5433f..401be14aaca02 100644 --- a/ci/deps/actions-310-numpydev.yaml +++ b/ci/deps/actions-310-numpydev.yaml @@ -9,6 +9,7 @@ dependencies: - pytest-cov - pytest-xdist>=1.31 - hypothesis>=5.5.3 + - pytest-asyncio>=0.17 # pandas dependencies - python-dateutil diff --git a/ci/deps/actions-310.yaml b/ci/deps/actions-310.yaml index bbc468f9d8f43..dac1219245e84 100644 --- a/ci/deps/actions-310.yaml +++ b/ci/deps/actions-310.yaml @@ -11,6 +11,8 @@ dependencies: - pytest-xdist>=1.31 - hypothesis>=5.5.3 - psutil + - pytest-asyncio>=0.17 + - boto3 # required dependencies - python-dateutil @@ -21,6 +23,7 @@ dependencies: - beautifulsoup4 - blosc - bottleneck + - brotlipy - fastparquet - fsspec - html5lib @@ -39,6 +42,7 @@ dependencies: - pytables - pyarrow - pyreadstat + - python-snappy - pyxlsb - s3fs - scipy diff --git a/ci/deps/actions-38-downstream_compat.yaml b/ci/deps/actions-38-downstream_compat.yaml index f3fa95d03c98e..01415122e6076 100644 --- a/ci/deps/actions-38-downstream_compat.yaml +++ b/ci/deps/actions-38-downstream_compat.yaml @@ -12,6 +12,8 @@ dependencies: - pytest-xdist>=1.31 - hypothesis>=5.5.3 - psutil + - pytest-asyncio>=0.17 + - boto3 # required dependencies - python-dateutil @@ -21,6 +23,7 @@ dependencies: # optional dependencies - beautifulsoup4 - blosc + - brotlipy - bottleneck - fastparquet - fsspec @@ -35,10 +38,11 @@ dependencies: - odfpy - pandas-gbq - psycopg2 - - pymysql - - pytables - pyarrow + - pymysql - pyreadstat + - pytables + - python-snappy - pyxlsb - s3fs - scipy @@ -52,17 +56,14 @@ dependencies: # downstream packages - aiobotocore - - boto3 - botocore - cftime - dask - ipython - geopandas - - python-snappy - seaborn - scikit-learn - statsmodels - - brotlipy - coverage - pandas-datareader - pyyaml diff --git a/ci/deps/actions-38-minimum_versions.yaml b/ci/deps/actions-38-minimum_versions.yaml index 2e782817f3f14..f3a967f67cbc3 100644 --- a/ci/deps/actions-38-minimum_versions.yaml +++ b/ci/deps/actions-38-minimum_versions.yaml @@ -13,6 +13,8 @@ dependencies: - pytest-xdist>=1.31 - hypothesis>=5.5.3 - psutil + - pytest-asyncio>=0.17 + - boto3 # required dependencies - python-dateutil=2.8.1 @@ -23,6 +25,7 @@ dependencies: - beautifulsoup4=4.8.2 - blosc=1.20.1 - bottleneck=1.3.1 + - brotlipy=0.7.0 - fastparquet=0.4.0 - fsspec=0.7.4 - html5lib=1.1 @@ -37,10 +40,11 @@ dependencies: - openpyxl=3.0.3 - pandas-gbq=0.14.0 - psycopg2=2.8.4 - - pymysql=0.10.1 - - pytables=3.6.1 - pyarrow=1.0.1 + - pymysql=0.10.1 - pyreadstat=1.1.0 + - pytables=3.6.1 + - python-snappy=0.6.0 - pyxlsb=1.0.6 - s3fs=0.4.0 - scipy=1.4.1 diff --git a/ci/deps/actions-38.yaml b/ci/deps/actions-38.yaml index 60db02def8a3d..79cd831051c2f 100644 --- a/ci/deps/actions-38.yaml +++ b/ci/deps/actions-38.yaml @@ -11,6 +11,8 @@ dependencies: - pytest-xdist>=1.31 - hypothesis>=5.5.3 - psutil + - pytest-asyncio>=0.17 + - boto3 # required dependencies - python-dateutil @@ -21,6 +23,7 @@ dependencies: - beautifulsoup4 - blosc - bottleneck + - brotlipy - fastparquet - fsspec - html5lib @@ -34,10 +37,11 @@ dependencies: - odfpy - pandas-gbq - psycopg2 - - pymysql - - pytables - pyarrow + - pymysql - pyreadstat + - pytables + - python-snappy - pyxlsb - s3fs - scipy diff --git a/ci/deps/actions-39.yaml b/ci/deps/actions-39.yaml index 2d6430afd0b36..1c681104f3196 100644 --- a/ci/deps/actions-39.yaml +++ b/ci/deps/actions-39.yaml @@ -11,6 +11,8 @@ dependencies: - pytest-xdist>=1.31 - hypothesis>=5.5.3 - psutil + - pytest-asyncio>=0.17 + - boto3 # required dependencies - python-dateutil @@ -21,6 +23,7 @@ dependencies: - beautifulsoup4 - blosc - bottleneck + - brotlipy - fastparquet - fsspec - html5lib @@ -35,9 +38,10 @@ dependencies: - pandas-gbq - psycopg2 - pymysql - - pytables - pyarrow - pyreadstat + - pytables + - python-snappy - pyxlsb - s3fs - scipy diff --git a/ci/deps/circle-38-arm64.yaml b/ci/deps/circle-38-arm64.yaml index 60608c3ee1a86..66fedccc5eca7 100644 --- a/ci/deps/circle-38-arm64.yaml +++ b/ci/deps/circle-38-arm64.yaml @@ -4,18 +4,52 @@ channels: dependencies: - python=3.8 - # tools - - cython>=0.29.24 + # test dependencies + - cython=0.29.24 - pytest>=6.0 + - pytest-cov - pytest-xdist>=1.31 - hypothesis>=5.5.3 + - psutil + - pytest-asyncio>=0.17 + - boto3 - # pandas dependencies - - botocore>=1.11 - - flask - - moto - - numpy + # required dependencies - python-dateutil + - numpy - pytz + + # optional dependencies + - beautifulsoup4 + - blosc + - bottleneck + - brotlipy + - fastparquet + - fsspec + - html5lib + - gcsfs + - jinja2 + - lxml + - matplotlib + - numba + - numexpr + - openpyxl + - odfpy + - pandas-gbq + - psycopg2 + - pyarrow + - pymysql + # Not provided on ARM + #- pyreadstat + - pytables + - python-snappy + - pyxlsb + - s3fs + - scipy + - sqlalchemy + - tabulate + - xarray + - xlrd + - xlsxwriter + - xlwt - zstandard - - pip diff --git a/doc/source/getting_started/install.rst b/doc/source/getting_started/install.rst index 8106efcfcfd98..e312889f2eb6a 100644 --- a/doc/source/getting_started/install.rst +++ b/doc/source/getting_started/install.rst @@ -410,5 +410,7 @@ Compression ========================= ================== ============================================================= Dependency Minimum Version Notes ========================= ================== ============================================================= -Zstandard Zstandard compression +brotli 0.7.0 Brotli compression +python-snappy 0.6.0 Snappy compression +Zstandard 0.15.2 Zstandard compression ========================= ================== ============================================================= diff --git a/environment.yml b/environment.yml index da5d6fabcde20..0a87e2b56f4cb 100644 --- a/environment.yml +++ b/environment.yml @@ -69,7 +69,7 @@ dependencies: - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 - - pytest-asyncio + - pytest-asyncio>=0.17 - pytest-instafail # downstream tests diff --git a/pandas/compat/_optional.py b/pandas/compat/_optional.py index cb9b0c6de6d3b..e69bee5c647d8 100644 --- a/pandas/compat/_optional.py +++ b/pandas/compat/_optional.py @@ -13,6 +13,7 @@ "bs4": "4.8.2", "blosc": "1.20.1", "bottleneck": "1.3.1", + "brotli": "0.7.0", "fastparquet": "0.4.0", "fsspec": "0.7.4", "html5lib": "1.1", @@ -34,6 +35,7 @@ "pyxlsb": "1.0.6", "s3fs": "0.4.0", "scipy": "1.4.1", + "snappy": "0.6.0", "sqlalchemy": "1.4.0", "tables": "3.6.1", "tabulate": "0.8.7", @@ -50,12 +52,14 @@ INSTALL_MAPPING = { "bs4": "beautifulsoup4", "bottleneck": "Bottleneck", + "brotli": "brotlipy", + "jinja2": "Jinja2", "lxml.etree": "lxml", "odf": "odfpy", "pandas_gbq": "pandas-gbq", - "tables": "pytables", + "snappy": "python-snappy", "sqlalchemy": "SQLAlchemy", - "jinja2": "Jinja2", + "tables": "pytables", } @@ -66,6 +70,13 @@ def get_version(module: types.ModuleType) -> str: version = getattr(module, "__VERSION__", None) if version is None: + if module.__name__ == "brotli": + # brotli doesn't contain attributes to confirm it's version + return "" + if module.__name__ == "snappy": + # snappy doesn't contain attributes to confirm it's version + # See https://github.com/andrix/python-snappy/pull/119 + return "" raise ImportError(f"Can't determine version for {module.__name__}") if module.__name__ == "psycopg2": # psycopg2 appends " (dt dec pq3 ext lo64)" to it's version @@ -141,7 +152,7 @@ def import_optional_dependency( minimum_version = min_version if min_version is not None else VERSIONS.get(parent) if minimum_version: version = get_version(module_to_get) - if Version(version) < Version(minimum_version): + if version and Version(version) < Version(minimum_version): msg = ( f"Pandas requires version '{minimum_version}' or newer of '{parent}' " f"(version '{version}' currently installed)." diff --git a/pandas/tests/arrays/string_/test_string.py b/pandas/tests/arrays/string_/test_string.py index 22fe7bb0de949..b5b4007798135 100644 --- a/pandas/tests/arrays/string_/test_string.py +++ b/pandas/tests/arrays/string_/test_string.py @@ -504,7 +504,7 @@ def test_memory_usage(dtype): # GH 33963 if dtype.storage == "pyarrow": - pytest.skip("not applicable") + pytest.skip(f"not applicable for {dtype.storage}") series = pd.Series(["a", "b", "c"], dtype=dtype) diff --git a/pandas/tests/extension/arrow/test_bool.py b/pandas/tests/extension/arrow/test_bool.py index a73684868e3ae..7f4766bac0329 100644 --- a/pandas/tests/extension/arrow/test_bool.py +++ b/pandas/tests/extension/arrow/test_bool.py @@ -1,6 +1,11 @@ import numpy as np import pytest +from pandas.compat import ( + is_ci_environment, + is_platform_windows, +) + import pandas as pd import pandas._testing as tm from pandas.api.types import is_bool_dtype @@ -91,6 +96,10 @@ def test_reduce_series_boolean(self): pass +@pytest.mark.skipif( + is_ci_environment() and is_platform_windows(), + reason="Causes stack overflow on Windows CI", +) class TestReduceBoolean(base.BaseBooleanReduceTests): pass diff --git a/pandas/tests/extension/base/ops.py b/pandas/tests/extension/base/ops.py index 1d3d736ca7ee2..a1d232b737da7 100644 --- a/pandas/tests/extension/base/ops.py +++ b/pandas/tests/extension/base/ops.py @@ -114,17 +114,22 @@ def test_add_series_with_extension_array(self, data): self.assert_series_equal(result, expected) @pytest.mark.parametrize("box", [pd.Series, pd.DataFrame]) - def test_direct_arith_with_ndframe_returns_not_implemented(self, data, box): + def test_direct_arith_with_ndframe_returns_not_implemented( + self, request, data, box + ): # EAs should return NotImplemented for ops with Series/DataFrame # Pandas takes care of unboxing the series and calling the EA's op. other = pd.Series(data) if box is pd.DataFrame: other = other.to_frame() - if hasattr(data, "__add__"): - result = data.__add__(other) - assert result is NotImplemented - else: - raise pytest.skip(f"{type(data).__name__} does not implement add") + if not hasattr(data, "__add__"): + request.node.add_marker( + pytest.mark.xfail( + reason=f"{type(data).__name__} does not implement add" + ) + ) + result = data.__add__(other) + assert result is NotImplemented class BaseComparisonOpsTests(BaseOpsUtil): diff --git a/pandas/tests/extension/json/test_json.py b/pandas/tests/extension/json/test_json.py index d530a75b74c8f..84491adb30ef6 100644 --- a/pandas/tests/extension/json/test_json.py +++ b/pandas/tests/extension/json/test_json.py @@ -1,5 +1,6 @@ import collections import operator +import sys import pytest @@ -155,20 +156,32 @@ def test_contains(self, data): class TestConstructors(BaseJSON, base.BaseConstructorsTests): - @pytest.mark.skip(reason="not implemented constructor from dtype") + @pytest.mark.xfail(reason="not implemented constructor from dtype") def test_from_dtype(self, data): # construct from our dtype & string dtype - pass + super(self).test_from_dtype(data) @pytest.mark.xfail(reason="RecursionError, GH-33900") def test_series_constructor_no_data_with_index(self, dtype, na_value): # RecursionError: maximum recursion depth exceeded in comparison - super().test_series_constructor_no_data_with_index(dtype, na_value) + rec_limit = sys.getrecursionlimit() + try: + # Limit to avoid stack overflow on Windows CI + sys.setrecursionlimit(100) + super().test_series_constructor_no_data_with_index(dtype, na_value) + finally: + sys.setrecursionlimit(rec_limit) @pytest.mark.xfail(reason="RecursionError, GH-33900") def test_series_constructor_scalar_na_with_index(self, dtype, na_value): # RecursionError: maximum recursion depth exceeded in comparison - super().test_series_constructor_scalar_na_with_index(dtype, na_value) + rec_limit = sys.getrecursionlimit() + try: + # Limit to avoid stack overflow on Windows CI + sys.setrecursionlimit(100) + super().test_series_constructor_scalar_na_with_index(dtype, na_value) + finally: + sys.setrecursionlimit(rec_limit) @pytest.mark.xfail(reason="collection as scalar, GH-33901") def test_series_constructor_scalar_with_index(self, data, dtype): diff --git a/pandas/tests/extension/test_categorical.py b/pandas/tests/extension/test_categorical.py index d21110e078709..1e17bf33c806c 100644 --- a/pandas/tests/extension/test_categorical.py +++ b/pandas/tests/extension/test_categorical.py @@ -50,7 +50,7 @@ def data(): """Length-100 array for this type. * data[0] and data[1] should both be non missing - * data[0] and data[1] should not gbe equal + * data[0] and data[1] should not be equal """ return Categorical(make_data()) @@ -86,7 +86,7 @@ class TestDtype(base.BaseDtypeTests): class TestInterface(base.BaseInterfaceTests): - @pytest.mark.skip(reason="Memory usage doesn't match") + @pytest.mark.xfail(reason="Memory usage doesn't match") def test_memory_usage(self, data): # Is this deliberate? super().test_memory_usage(data) @@ -149,13 +149,7 @@ class TestIndex(base.BaseIndexTests): class TestMissing(base.BaseMissingTests): - @pytest.mark.skip(reason="Not implemented") - def test_fillna_limit_pad(self, data_missing): - super().test_fillna_limit_pad(data_missing) - - @pytest.mark.skip(reason="Not implemented") - def test_fillna_limit_backfill(self, data_missing): - super().test_fillna_limit_backfill(data_missing) + pass class TestReduce(base.BaseNoReduceTests): @@ -163,7 +157,7 @@ class TestReduce(base.BaseNoReduceTests): class TestMethods(base.BaseMethodsTests): - @pytest.mark.skip(reason="Unobserved categories included") + @pytest.mark.xfail(reason="Unobserved categories included") def test_value_counts(self, all_data, dropna): return super().test_value_counts(all_data, dropna) @@ -184,10 +178,6 @@ def test_combine_add(self, data_repeated): expected = pd.Series([a + val for a in list(orig_data1)]) self.assert_series_equal(result, expected) - @pytest.mark.skip(reason="Not Applicable") - def test_fillna_length_mismatch(self, data_missing): - super().test_fillna_length_mismatch(data_missing) - class TestCasting(base.BaseCastingTests): @pytest.mark.parametrize("cls", [Categorical, CategoricalIndex]) diff --git a/pandas/tests/extension/test_datetime.py b/pandas/tests/extension/test_datetime.py index a64b42fad9415..92796c604333d 100644 --- a/pandas/tests/extension/test_datetime.py +++ b/pandas/tests/extension/test_datetime.py @@ -175,9 +175,7 @@ class TestMissing(BaseDatetimeTests, base.BaseMissingTests): class TestReshaping(BaseDatetimeTests, base.BaseReshapingTests): - @pytest.mark.skip(reason="We have DatetimeTZBlock") - def test_concat(self, data, in_frame): - pass + pass class TestSetitem(BaseDatetimeTests, base.BaseSetitemTests): diff --git a/pandas/tests/extension/test_interval.py b/pandas/tests/extension/test_interval.py index e2f4d69c489ba..0f916cea9d518 100644 --- a/pandas/tests/extension/test_interval.py +++ b/pandas/tests/extension/test_interval.py @@ -121,9 +121,9 @@ def test_reduce_series_numeric(self, data, all_numeric_reductions, skipna): class TestMethods(BaseInterval, base.BaseMethodsTests): - @pytest.mark.skip(reason="addition is not defined for intervals") + @pytest.mark.xfail(reason="addition is not defined for intervals") def test_combine_add(self, data_repeated): - pass + super().test_combine_add(data_repeated) @pytest.mark.xfail( reason="Raises with incorrect message bc it disallows *all* listlikes " @@ -134,29 +134,31 @@ def test_fillna_length_mismatch(self, data_missing): class TestMissing(BaseInterval, base.BaseMissingTests): - # Index.fillna only accepts scalar `value`, so we have to skip all + # Index.fillna only accepts scalar `value`, so we have to xfail all # non-scalar fill tests. - unsupported_fill = pytest.mark.skip("Unsupported fillna option.") + unsupported_fill = pytest.mark.xfail( + reason="Unsupported fillna option for Interval." + ) @unsupported_fill def test_fillna_limit_pad(self): - pass + super().test_fillna_limit_pad() @unsupported_fill def test_fillna_series_method(self): - pass + super().test_fillna_series_method() @unsupported_fill def test_fillna_limit_backfill(self): - pass + super().test_fillna_limit_backfill() @unsupported_fill def test_fillna_no_op_returns_copy(self): - pass + super().test_fillna_no_op_returns_copy() @unsupported_fill def test_fillna_series(self): - pass + super().test_fillna_series() def test_fillna_non_scalar_raises(self, data_missing): msg = "can only insert Interval objects and NA into an IntervalArray" @@ -173,9 +175,9 @@ class TestSetitem(BaseInterval, base.BaseSetitemTests): class TestPrinting(BaseInterval, base.BasePrintingTests): - @pytest.mark.skip(reason="custom repr") + @pytest.mark.xfail(reason="Interval has custom repr") def test_array_repr(self, data, size): - pass + super().test_array_repr() class TestParsing(BaseInterval, base.BaseParsingTests): diff --git a/pandas/tests/extension/test_numpy.py b/pandas/tests/extension/test_numpy.py index 2e1112ccf2205..ee181101a181a 100644 --- a/pandas/tests/extension/test_numpy.py +++ b/pandas/tests/extension/test_numpy.py @@ -208,10 +208,15 @@ def test_series_constructor_scalar_with_index(self, data, dtype): class TestDtype(BaseNumPyTests, base.BaseDtypeTests): - @pytest.mark.skip(reason="Incorrect expected.") - # we unsurprisingly clash with a NumPy name. - def test_check_dtype(self, data): - pass + def test_check_dtype(self, data, request): + if data.dtype.numpy_dtype == "object": + request.node.add_marker( + pytest.mark.xfail( + reason=f"PandasArray expectedly clashes with a " + f"NumPy name: {data.dtype.numpy_dtype}" + ) + ) + super().test_check_dtype(data) class TestGetitem(BaseNumPyTests, base.BaseGetitemTests): @@ -345,11 +350,6 @@ def test_fillna_frame(self, data_missing): class TestReshaping(BaseNumPyTests, base.BaseReshapingTests): - @pytest.mark.skip(reason="Incorrect expected.") - def test_merge(self, data, na_value): - # Fails creating expected (key column becomes a PandasDtype because) - super().test_merge(data, na_value) - @pytest.mark.parametrize( "in_frame", [ diff --git a/pandas/tests/extension/test_string.py b/pandas/tests/extension/test_string.py index 4256142556894..e96850e4e945b 100644 --- a/pandas/tests/extension/test_string.py +++ b/pandas/tests/extension/test_string.py @@ -28,7 +28,7 @@ def split_array(arr): if arr.dtype.storage != "pyarrow": - pytest.skip("chunked array n/a") + pytest.skip("only applicable for pyarrow chunked array n/a") def _split_array(arr): import pyarrow as pa @@ -162,9 +162,9 @@ class TestMethods(base.BaseMethodsTests): def test_value_counts(self, all_data, dropna): return super().test_value_counts(all_data, dropna) - @pytest.mark.skip(reason="returns nullable") + @pytest.mark.xfail(reason="returns nullable: GH 44692") def test_value_counts_with_normalize(self, data): - pass + super().test_value_counts_with_normalize(data) class TestCasting(base.BaseCastingTests): diff --git a/pandas/tests/plotting/frame/test_frame.py b/pandas/tests/plotting/frame/test_frame.py index ff247349ff4d5..449a1c69a4ef6 100644 --- a/pandas/tests/plotting/frame/test_frame.py +++ b/pandas/tests/plotting/frame/test_frame.py @@ -167,12 +167,11 @@ def test_nullable_int_plot(self): df = DataFrame( { "A": [1, 2, 3, 4, 5], - "B": [1.0, 2.0, 3.0, 4.0, 5.0], - "C": [7, 5, np.nan, 3, 2], + "B": [1, 2, 3, 4, 5], + "C": np.array([7, 5, np.nan, 3, 2], dtype=object), "D": pd.to_datetime(dates, format="%Y").view("i8"), "E": pd.to_datetime(dates, format="%Y", utc=True).view("i8"), - }, - dtype=np.int64, + } ) _check_plot_works(df.plot, x="A", y="B") diff --git a/pandas/tests/plotting/test_converter.py b/pandas/tests/plotting/test_converter.py index fe8620ef76c4b..d595f4b453b28 100644 --- a/pandas/tests/plotting/test_converter.py +++ b/pandas/tests/plotting/test_converter.py @@ -334,7 +334,7 @@ def test_conversion(self): rs = self.pc.convert( np.array( - ["2012-01-01 00:00:00+0000", "2012-01-02 00:00:00+0000"], + ["2012-01-01 00:00:00", "2012-01-02 00:00:00"], dtype="datetime64[ns]", ), None, diff --git a/pyproject.toml b/pyproject.toml index 1d318ab5f70c3..318a7398e1035 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,6 +57,7 @@ markers = [ "arm_slow: mark a test as slow for arm64 architecture", "arraymanager: mark a test to run with ArrayManager enabled", ] +asyncio_mode = "strict" [tool.mypy] # Import discovery diff --git a/requirements-dev.txt b/requirements-dev.txt index ac525f1d09fbe..6fd3ac53c50cb 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -47,7 +47,7 @@ flask pytest>=6.0 pytest-cov pytest-xdist>=1.31 -pytest-asyncio +pytest-asyncio>=0.17 pytest-instafail seaborn statsmodels