AlenkaF commented on code in PR #41709:
URL: https://github.com/apache/arrow/pull/41709#discussion_r2541377359
##########
python/pyarrow/types.pxi:
##########
@@ -147,6 +147,10 @@ def _is_primitive(Type type):
return is_primitive(type)
+def _is_nested(data_type):
+ return is_nested(data_type.id)
Review Comment:
```suggestion
def _is_nested(data_type):
# This is simply a redirect, the official API is in pyarrow.types.
return is_nested(data_type.id)
```
##########
python/pyarrow/includes/libarrow.pxd:
##########
@@ -3026,3 +3026,6 @@ cdef extern from "arrow/python/udf.h" namespace
"arrow::py" nogil:
cdef extern from "arrow/compute/cast.h" namespace "arrow::compute":
CResult[CDatum] Cast(const CDatum& value, const CCastOptions& options)
+
+cdef extern from "arrow/type_traits.h" namespace "arrow":
+ c_bool is_nested(Type type_id)
Review Comment:
I think we can simply add `is_nested ` together with `is_primitive` and
`is_numeric` here:
https://github.com/apache/arrow/blob/a15803601f439b110ba676fa5ba28473e50f50bc/python/pyarrow/includes/libarrow.pxd#L205C12-L206
Can't make this comment in form of a suggestion though, which would help
finalising this PR faster.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]