Bug Report
Environment
deeplake==3.9.52
numpy>=2.0 (tested on 2.4.2)
Description
NumPy 2.x (NEP 50) removed support for passing raw Python scalars (int, float, bool) as the first argument to np.can_cast. This causes a TypeError when DeepLake attempts to validate scalar samples in get_incompatible_dtype inside deeplake/util/casting.py.
Error
TypeError: can_cast() does not support Python ints, floats, and complex because the result used to depend on the value.
The offending line in deeplake/util/casting.py:
if np.can_cast(samples, dtype) # samples is a raw Python float/int
Fix
A fix is available in this PR:
#3143
References