Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions python/pyarrow/includes/libarrow.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ cdef extern from "arrow/api.h" namespace "arrow" nogil:

c_bool is_primitive(Type type)
c_bool is_numeric(Type type)
c_bool is_nested(Type type)

cdef cppclass CArrayStatistics" arrow::ArrayStatistics":
optional[CArrayStatisticsCountType] null_count
Expand Down
5 changes: 5 additions & 0 deletions python/pyarrow/types.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ def _is_primitive(Type type):
return is_primitive(type)


def _is_nested(Type type):
# This is simply a redirect, the official API is in pyarrow.types.
return is_nested(type)


def _get_pandas_type(arrow_type, coerce_to_ns=False):
cdef Type type_id = arrow_type.id
cdef dict pandas_type_map = _get_pandas_type_map()
Expand Down
6 changes: 1 addition & 5 deletions python/pyarrow/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@
lib.Type_DURATION} | _TIME_TYPES | _DATE_TYPES |
_INTERVAL_TYPES)
_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,
lib.Type_RUN_END_ENCODED} | _UNION_TYPES


class TypesEnum(IntEnum):
Expand Down Expand Up @@ -257,7 +253,7 @@ def is_union(t):

@doc(is_null, datatype="nested type")
def is_nested(t):
return t.id in _NESTED_TYPES
return lib._is_nested(t.id)


@doc(is_null, datatype="run-end encoded")
Expand Down
Loading