Blame SOURCES/0005-TST-Add-missing-skips-for-unavailable-pyarrow.patch

4898f3
From b022df8968b889c8f55832a909c602840cfe1840 Mon Sep 17 00:00:00 2001
4898f3
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
4898f3
Date: Tue, 13 Feb 2024 02:20:43 -0500
4898f3
Subject: [PATCH 5/6] TST: Add missing skips for unavailable pyarrow
4898f3
4898f3
The `all_parsers` fixture has this check, but some of the other fixtures
4898f3
were missing it.
4898f3
4898f3
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
4898f3
---
4898f3
 pandas/core/arrays/arrow/accessors.py     | 2 +-
4898f3
 pandas/tests/io/formats/style/test_bar.py | 3 +++
4898f3
 pandas/tests/io/parser/conftest.py        | 4 ++++
4898f3
 3 files changed, 8 insertions(+), 1 deletion(-)
4898f3
4898f3
diff --git a/pandas/core/arrays/arrow/accessors.py b/pandas/core/arrays/arrow/accessors.py
4898f3
index 124f8fb6ad..3175781e53 100644
4898f3
--- a/pandas/core/arrays/arrow/accessors.py
4898f3
+++ b/pandas/core/arrays/arrow/accessors.py
4898f3
@@ -46,7 +46,7 @@ class ArrowAccessor(metaclass=ABCMeta):
4898f3
 
4898f3
     def _validate(self, data):
4898f3
         dtype = data.dtype
4898f3
-        if not isinstance(dtype, ArrowDtype):
4898f3
+        if not pa_version_under10p1 and not isinstance(dtype, ArrowDtype):
4898f3
             # Raise AttributeError so that inspect can handle non-struct Series.
4898f3
             raise AttributeError(self._validation_msg.format(dtype=dtype))
4898f3
 
4898f3
diff --git a/pandas/tests/io/formats/style/test_bar.py b/pandas/tests/io/formats/style/test_bar.py
4898f3
index b0e4712e8b..41206da56e 100644
4898f3
--- a/pandas/tests/io/formats/style/test_bar.py
4898f3
+++ b/pandas/tests/io/formats/style/test_bar.py
4898f3
@@ -3,6 +3,8 @@ import io
4898f3
 import numpy as np
4898f3
 import pytest
4898f3
 
4898f3
+from pandas.compat._optional import VERSIONS
4898f3
+
4898f3
 from pandas import (
4898f3
     NA,
4898f3
     DataFrame,
4898f3
@@ -347,6 +349,7 @@ def test_styler_bar_with_NA_values():
4898f3
 
4898f3
 
4898f3
 def test_style_bar_with_pyarrow_NA_values():
4898f3
+    pytest.importorskip("pyarrow", VERSIONS["pyarrow"])
4898f3
     data = """name,age,test1,test2,teacher
4898f3
         Adam,15,95.0,80,Ashby
4898f3
         Bob,16,81.0,82,Ashby
4898f3
diff --git a/pandas/tests/io/parser/conftest.py b/pandas/tests/io/parser/conftest.py
4898f3
index 6d5f870f07..88ccf5fee8 100644
4898f3
--- a/pandas/tests/io/parser/conftest.py
4898f3
+++ b/pandas/tests/io/parser/conftest.py
4898f3
@@ -165,6 +165,7 @@ def pyarrow_parser_only(request):
4898f3
     """
4898f3
     Fixture all of the CSV parsers using the Pyarrow engine.
4898f3
     """
4898f3
+    pytest.importorskip("pyarrow", VERSIONS["pyarrow"])
4898f3
     return request.param()
4898f3
 
4898f3
 
4898f3
@@ -198,6 +199,9 @@ def all_parsers_all_precisions(request):
4898f3
     Fixture for all allowable combinations of parser
4898f3
     and float precision
4898f3
     """
4898f3
+    parser = request.param[0]
4898f3
+    if parser.engine == "pyarrow":
4898f3
+        pytest.importorskip("pyarrow", VERSIONS["pyarrow"])
4898f3
     return request.param
4898f3
 
4898f3
 
4898f3
-- 
4898f3
2.43.0
4898f3