riptable
riptable copied to clipboard
``rt.putmask`` does nothing when dtypes are incompatible
When called with two arrays which have incompatible dtypes (according to numpy's "safe" casting rule), np.putmask raises a TypeError with a message indicating the types are incompatible.
In riptable 1.0.54 (and earlier versions), rt.putmask ignores the mismatch and silently does nothing -- it neither raises an exception nor modifies the target array. rt.putmask should be checking for compatibility of the array dtypes using e.g. np.can_cast(source.dtype, target.dtype, casting='safe') and raising a TypeError when the check fails.