Skip to content

Commit 1f21139

Browse files
committed
Also catch ValueError in all_equal
The call to `np.any(array)` in zarr.util.all_equal triggers the following ValueError: ``` > return ufunc.reduce(obj, axis, dtype, out, **passkwargs) E ValueError: invalid literal for int() with base 10: 'baz' ``` Extending the catch block allows test_array_with_categorize_filter to pass, but it's unclear if this points to a deeper issue.
1 parent d27e4ed commit 1f21139

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

zarr/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ def all_equal(value: Any, array: Any):
670670
# optimized to return on the first truthy value in `array`.
671671
try:
672672
return not np.any(array)
673-
except TypeError: # pragma: no cover
673+
except (TypeError, ValueError): # pragma: no cover
674674
pass
675675
if np.issubdtype(array.dtype, np.object_):
676676
# we have to flatten the result of np.equal to handle outputs like

0 commit comments

Comments
 (0)