diff --git a/pandas/core/arrays/arrow/accessors.py b/pandas/core/arrays/arrow/accessors.py index d9a80b699b0bb..09c0497dfce83 100644 --- a/pandas/core/arrays/arrow/accessors.py +++ b/pandas/core/arrays/arrow/accessors.py @@ -46,7 +46,7 @@ def _is_valid_pyarrow_dtype(self, pyarrow_dtype) -> bool: def _validate(self, data) -> None: dtype = data.dtype - if not isinstance(dtype, ArrowDtype): + if not pa_version_under10p1 and not isinstance(dtype, ArrowDtype): # Raise AttributeError so that inspect can handle non-struct Series. raise AttributeError(self._validation_msg.format(dtype=dtype)) diff --git a/pandas/tests/io/formats/style/test_bar.py b/pandas/tests/io/formats/style/test_bar.py index d28c7c566d851..41206da56ee07 100644 --- a/pandas/tests/io/formats/style/test_bar.py +++ b/pandas/tests/io/formats/style/test_bar.py @@ -3,6 +3,8 @@ import numpy as np import pytest +from pandas.compat._optional import VERSIONS + from pandas import ( NA, DataFrame, @@ -347,7 +349,7 @@ def test_styler_bar_with_NA_values(): def test_style_bar_with_pyarrow_NA_values(): - pytest.importorskip("pyarrow") + pytest.importorskip("pyarrow", VERSIONS["pyarrow"]) data = """name,age,test1,test2,teacher Adam,15,95.0,80,Ashby Bob,16,81.0,82,Ashby diff --git a/pandas/tests/io/parser/conftest.py b/pandas/tests/io/parser/conftest.py index 90f77a7024235..49f2ad284429c 100644 --- a/pandas/tests/io/parser/conftest.py +++ b/pandas/tests/io/parser/conftest.py @@ -174,6 +174,7 @@ def pyarrow_parser_only(request): """ Fixture all of the CSV parsers using the Pyarrow engine. """ + pytest.importorskip("pyarrow", VERSIONS["pyarrow"]) return request.param() @@ -216,6 +217,9 @@ def all_parsers_all_precisions(request): Fixture for all allowable combinations of parser and float precision """ + parser = request.param[0] + if parser.engine == "pyarrow": + pytest.importorskip("pyarrow", VERSIONS["pyarrow"]) return request.param