Skip to content

Commit 1cba242

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 1d7aedc commit 1cba242

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
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 & 0 deletions
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,6 +349,7 @@ def test_styler_bar_with_NA_values():
347349

348350

349351
def test_style_bar_with_pyarrow_NA_values():
352+
pytest.importorskip("pyarrow", VERSIONS["pyarrow"])
350353
data = """name,age,test1,test2,teacher
351354
Adam,15,95.0,80,Ashby
352355
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
@@ -165,6 +165,7 @@ def pyarrow_parser_only(request):
165165
"""
166166
Fixture all of the CSV parsers using the Pyarrow engine.
167167
"""
168+
pytest.importorskip("pyarrow", VERSIONS["pyarrow"])
168169
return request.param()
169170

170171

@@ -198,6 +199,9 @@ def all_parsers_all_precisions(request):
198199
Fixture for all allowable combinations of parser
199200
and float precision
200201
"""
202+
parser = request.param[0]
203+
if parser.engine == "pyarrow":
204+
pytest.importorskip("pyarrow", VERSIONS["pyarrow"])
201205
return request.param
202206

203207

0 commit comments

Comments
 (0)