From c58f2057b8c8a7fa79654c45a83c963c013a3aa3 Mon Sep 17 00:00:00 2001 From: MeeseeksMachine <39504233+meeseeksmachine@users.noreply.github.com> Date: Fri, 14 Oct 2022 21:27:30 +0200 Subject: [PATCH] Backport PR #48457 on branch 1.5.x (TST: Fix unsigned pyarrow types in SIGNED_INT_PYARROW_DTYPES) (#49093) Backport PR #48457: TST: Fix unsigned pyarrow types in SIGNED_INT_PYARROW_DTYPES Co-authored-by: Gaurav Sheni --- pandas/_testing/__init__.py | 2 +- pandas/tests/extension/test_arrow.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pandas/_testing/__init__.py b/pandas/_testing/__init__.py index c15e597558221..e0e1b49abaaab 100644 --- a/pandas/_testing/__init__.py +++ b/pandas/_testing/__init__.py @@ -197,7 +197,7 @@ import pyarrow as pa UNSIGNED_INT_PYARROW_DTYPES = [pa.uint8(), pa.uint16(), pa.uint32(), pa.uint64()] - SIGNED_INT_PYARROW_DTYPES = [pa.uint8(), pa.int16(), pa.int32(), pa.uint64()] + SIGNED_INT_PYARROW_DTYPES = [pa.int8(), pa.int16(), pa.int32(), pa.int64()] ALL_INT_PYARROW_DTYPES = UNSIGNED_INT_PYARROW_DTYPES + SIGNED_INT_PYARROW_DTYPES FLOAT_PYARROW_DTYPES = [pa.float32(), pa.float64()] diff --git a/pandas/tests/extension/test_arrow.py b/pandas/tests/extension/test_arrow.py index dae7d2f01d5e2..b7ddb1f248765 100644 --- a/pandas/tests/extension/test_arrow.py +++ b/pandas/tests/extension/test_arrow.py @@ -1570,6 +1570,13 @@ def test_add_series_with_extension_array(self, data, request): reason=f"add_checked not implemented for {pa_dtype}", ) ) + elif pa_dtype.equals("int8"): + request.node.add_marker( + pytest.mark.xfail( + raises=pa.ArrowInvalid, + reason=f"raises on overflow for {pa_dtype}", + ) + ) super().test_add_series_with_extension_array(data)