diff --git a/python/pyarrow/tests/test_types.py b/python/pyarrow/tests/test_types.py index 9b5c5efe1c3..9fd46b57ca1 100644 --- a/python/pyarrow/tests/test_types.py +++ b/python/pyarrow/tests/test_types.py @@ -244,7 +244,10 @@ def test_is_nested_or_struct(): assert types.is_nested(pa.large_list(pa.int32())) assert types.is_nested(pa.list_view(pa.int32())) assert types.is_nested(pa.large_list_view(pa.int32())) + assert types.is_nested(pa.map_(pa.string(), pa.int32())) + assert types.is_nested(pa.run_end_encoded(pa.int32(), pa.string())) assert not types.is_nested(pa.int32()) + assert not types.is_nested(pa.dictionary(pa.int32(), pa.string())) def test_is_union(): diff --git a/python/pyarrow/types.py b/python/pyarrow/types.py index ab4e5d1b992..b72427e54d0 100644 --- a/python/pyarrow/types.py +++ b/python/pyarrow/types.py @@ -45,7 +45,8 @@ _UNION_TYPES = {lib.Type_SPARSE_UNION, lib.Type_DENSE_UNION} _NESTED_TYPES = {lib.Type_LIST, lib.Type_FIXED_SIZE_LIST, lib.Type_LARGE_LIST, lib.Type_LIST_VIEW, lib.Type_LARGE_LIST_VIEW, - lib.Type_STRUCT, lib.Type_MAP} | _UNION_TYPES + lib.Type_STRUCT, lib.Type_MAP, + lib.Type_RUN_END_ENCODED} | _UNION_TYPES class TypesEnum(IntEnum):