llama90 commented on code in PR #40761:
URL: https://github.com/apache/arrow/pull/40761#discussion_r1553561365
##########
python/pyarrow/types.py:
##########
@@ -59,92 +69,92 @@ def is_null(t):
@doc(is_null, datatype="boolean")
def is_boolean(t):
- return t.id == lib.Type_BOOL
+ return _is_primitive(t) and _bit_width(t) == 1
Review Comment:
Is my understanding correct? Does this mean that `types.pxi` should be
implemented using functions exposed in `type_traits.h` and `types.py` should
only call functions with `_` as a prefix? Sorry for asking again... 🥲
- pyarrow/types.pxi
```
def _is_boolean(data_type):
"""
This function checks whether the `data_type` is a boolean type.
Parameters
----------
data_type : DataType
The data type to check
Returns
-------
bool
True if `data_type` is a boolean type, False otherwise.
"""
return _is_primitive(data_type) and _bit_width(data_type) == 1
```
- types.py
```
def is_boolean(t):
return _is_boolean(t)
```
--
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]