jorisvandenbossche commented on issue #41016:
URL: https://github.com/apache/arrow/issues/41016#issuecomment-2109467539

   > Is there any workaround for this that doesn't involve iterating over the 
entire array and testing each value individually?
   
   A workaround to avoid the segfault is adding a call to `null_count` before 
calling `true_count`. Editing the original example, the below does not crash on 
pyarrow 15.0:
   
   ```python
   import pyarrow.compute
   a1 = pyarrow.array([True]*48 + [False]*48)
   a2 = pyarrow.array([True, False] * 48)
   res = pyarrow.compute.and_(a1, a2)
   # call null_count to populate it before calling true_count
   res.null_count
   true_count = res.true_count
   ```


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