Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: ArrowDtype raising for fixed size list #55000

Merged
merged 3 commits into from Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/source/whatsnew/v2.1.1.rst
Expand Up @@ -29,6 +29,7 @@ Fixed regressions

Bug fixes
~~~~~~~~~
- Fixed bug for :class:`ArrowDtype` raising ``NotImplementedError`` for fixed-size list (:issue:`55000`)
- Fixed bug in :meth:`DataFrame.stack` with ``future_stack=True`` and columns a non-:class:`MultiIndex` consisting of tuples (:issue:`54948`)

.. ---------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions pandas/core/dtypes/dtypes.py
Expand Up @@ -2148,6 +2148,8 @@ def type(self):
return CategoricalDtypeType
elif pa.types.is_list(pa_type) or pa.types.is_large_list(pa_type):
return list
elif pa.types.is_fixed_size_list(pa_type):
return list
elif pa.types.is_map(pa_type):
return list
elif pa.types.is_struct(pa_type):
Expand Down
9 changes: 9 additions & 0 deletions pandas/tests/extension/test_arrow.py
Expand Up @@ -2992,6 +2992,15 @@ def test_groupby_count_return_arrow_dtype(data_missing):
tm.assert_frame_equal(result, expected)


def test_fixed_size_list():
# GH#55000
ser = pd.Series(
[[1, 2], [3, 4]], dtype=ArrowDtype(pa.list_(pa.int64(), list_size=2))
)
result = ser.dtype.type
assert result == list


def test_arrowextensiondtype_dataframe_repr():
# GH 54062
df = pd.DataFrame(
Expand Down