diff --git a/pandas/core/dtypes/dtypes.py b/pandas/core/dtypes/dtypes.py index 1eb1a630056a2..3b2a70c59aee6 100644 --- a/pandas/core/dtypes/dtypes.py +++ b/pandas/core/dtypes/dtypes.py @@ -2261,7 +2261,7 @@ def type(self): elif pa.types.is_null(pa_type): # TODO: None? pd.NA? pa.null? return type(pa_type) - elif isinstance(pa_type, pa.ExtensionType): + elif hasattr(pa_type, "extension_name"): return type(self)(pa_type.storage_type).type raise NotImplementedError(pa_type) diff --git a/pandas/tests/extension/test_arrow.py b/pandas/tests/extension/test_arrow.py index 4fccf02e08bd6..1814b9b3b3484 100644 --- a/pandas/tests/extension/test_arrow.py +++ b/pandas/tests/extension/test_arrow.py @@ -3512,3 +3512,8 @@ def test_map_numeric_na_action(): result = ser.map(lambda x: 42, na_action="ignore") expected = pd.Series([42.0, 42.0, np.nan], dtype="float64") tm.assert_series_equal(result, expected) + + +@pytest.mark.skipif(condition=not hasattr(pa, "uuid"), reason="No pa extension type") +def test_arrow_extension_type(): + assert ArrowDtype(pa.uuid()).type is bytes