Skip to content

Commit 2724548

Browse files
committed
TST: Add missing skips for unavailable pyarrow
The `all_parsers` fixture has this check, but some of the other fixtures were missing it.
1 parent 2a1ca9d commit 2724548

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

pandas/core/arrays/arrow/accessors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def _is_valid_pyarrow_dtype(self, pyarrow_dtype) -> bool:
4646

4747
def _validate(self, data) -> None:
4848
dtype = data.dtype
49-
if not isinstance(dtype, ArrowDtype):
49+
if not pa_version_under10p1 and not isinstance(dtype, ArrowDtype):
5050
# Raise AttributeError so that inspect can handle non-struct Series.
5151
raise AttributeError(self._validation_msg.format(dtype=dtype))
5252

pandas/tests/io/formats/style/test_bar.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import numpy as np
44
import pytest
55

6+
from pandas.compat._optional import VERSIONS
7+
68
from pandas import (
79
NA,
810
DataFrame,
@@ -347,7 +349,7 @@ def test_styler_bar_with_NA_values():
347349

348350

349351
def test_style_bar_with_pyarrow_NA_values():
350-
pytest.importorskip("pyarrow")
352+
pytest.importorskip("pyarrow", VERSIONS["pyarrow"])
351353
data = """name,age,test1,test2,teacher
352354
Adam,15,95.0,80,Ashby
353355
Bob,16,81.0,82,Ashby

pandas/tests/io/parser/conftest.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ def pyarrow_parser_only(request):
174174
"""
175175
Fixture all of the CSV parsers using the Pyarrow engine.
176176
"""
177+
pytest.importorskip("pyarrow", VERSIONS["pyarrow"])
177178
return request.param()
178179

179180

@@ -216,6 +217,9 @@ def all_parsers_all_precisions(request):
216217
Fixture for all allowable combinations of parser
217218
and float precision
218219
"""
220+
parser = request.param[0]
221+
if parser.engine == "pyarrow":
222+
pytest.importorskip("pyarrow", VERSIONS["pyarrow"])
219223
return request.param
220224

221225

0 commit comments

Comments
 (0)