diff --git a/pandas/core/arrays/arrow/array.py b/pandas/core/arrays/arrow/array.py index 66bb12db277fc..1f35013075751 100644 --- a/pandas/core/arrays/arrow/array.py +++ b/pandas/core/arrays/arrow/array.py @@ -264,6 +264,12 @@ def factorize(self, na_sentinel: int = -1) -> tuple[np.ndarray, ExtensionArray]: return indices.values, uniques + def reshape(self, *args, **kwargs): + raise NotImplementedError( + f"{type(self)} does not support reshape " + f"as backed by a 1D pyarrow.ChunkedArray." + ) + def take( self, indices: TakeIndexer, diff --git a/pandas/tests/extension/test_arrow.py b/pandas/tests/extension/test_arrow.py index 4047c0db1fee4..03616267c3f86 100644 --- a/pandas/tests/extension/test_arrow.py +++ b/pandas/tests/extension/test_arrow.py @@ -99,6 +99,10 @@ def na_value(): return pd.NA +class TestBaseCasting(base.BaseCastingTests): + pass + + class TestConstructors(base.BaseConstructorsTests): @pytest.mark.xfail( reason=( @@ -111,6 +115,20 @@ def test_from_dtype(self, data): super().test_from_dtype(data) +@pytest.mark.xfail( + raises=NotImplementedError, reason="pyarrow.ChunkedArray backing is 1D." +) +class TestDim2Compat(base.Dim2CompatTests): + pass + + +@pytest.mark.xfail( + raises=NotImplementedError, reason="pyarrow.ChunkedArray backing is 1D." +) +class TestNDArrayBacked2D(base.NDArrayBacked2DTests): + pass + + class TestGetitemTests(base.BaseGetitemTests): @pytest.mark.xfail( reason=( @@ -179,6 +197,10 @@ def test_loc_iloc_frame_single_dtype(self, request, using_array_manager, data): super().test_loc_iloc_frame_single_dtype(data) +class TestBaseIndex(base.BaseIndexTests): + pass + + def test_arrowdtype_construct_from_string_type_with_parameters(): with pytest.raises(NotImplementedError, match="Passing pyarrow type"): ArrowDtype.construct_from_string("timestamp[s][pyarrow]")