Nishuuzz opened a new issue, #50847:
URL: https://github.com/apache/arrow/issues/50847

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   `pyarrow.types.is_nested()` reports that a run-end encoded type is not 
nested, but the C++ `arrow::is_nested()` says it is.
   
   ```python
   >>> import pyarrow as pa
   >>> t = pa.run_end_encoded(pa.int32(), pa.string())
   >>> t.num_fields
   2
   >>> pa.types.is_nested(t)
   False
   ```
   
   The predicate in Python is backed by a hardcoded `_NESTED_TYPES` set in 
`python/pyarrow/types.py`, and `Type_RUN_END_ENCODED` was never added to it. If 
you line that set up against `is_nested()` in `cpp/src/arrow/type_traits.h`, 
run-end encoded is the only type the two disagree about — everything else 
matches, including the list-view types.
   
   It also disagrees with the type itself: run-end encoded has two children 
(run ends and values), and every other type in pyarrow with children answers 
`True` here.
   
   The same thing happened with fixed-size list, reported in #40171 and fixed 
in #40172, and the list-view types were added later. This looks like the last 
one that got missed when run-end encoding was added.
   
   Tested with pyarrow 25.0.0 on Windows, and the same `_NESTED_TYPES` set is 
still there on main.
   
   ### Component(s)
   
   Python
   


-- 
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]

Reply via email to