Regression: wrong dtype error when comparing mask to True
#2808
Labels
bug
The problem described is something that must be fixed
True
#2808
Version of Awkward Array
2.4.9
Description and code to reproduce
I have some analysis code which eventually produces a mask of shape
n * var * bool
. As a diagnostic, I want to compare the mask toTrue
, flatten, and count_nonzero1. With awkward 2.3.1 and numpy 1.24.4, this worked. I updated my dependencies to awkward 2.4.9 and numpy 1.26.1, and I get a type error regarding the dtype. See the reproducer below (and the relevant parquet file, renamed to txt to allow for attachmentout.parquet.txt )
I'm a little rusty with this codebase at the moment , but I'm fairly confident this is a regression within awkward. Thanks in advance!
edit: Just for completeness, I'm using the obvious workaround of
np.count_nonzero(np.asarray(ak.flatten(arr == True, axis=None)))
->np.count_nonzero(np.asarray(ak.flatten(arr, axis=None)) == True)
Footnotes
I know I could just flatten and count_nonzero in this case, but sometimes it was conceptually cleaner to make it explicit - sometimes the check is compared to False. In any case, this comparison should work, and it worked previously. ↩
The text was updated successfully, but these errors were encountered: