File tree Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -263,6 +263,19 @@ def __new__(
263263 dtype = dtype ,
264264 )
265265
266+ # Check for mismatched signed/unsigned integer dtypes after casting
267+ left_dtype = left .dtype
268+ right_dtype = right .dtype
269+ if (
270+ left_dtype .kind in "iu"
271+ and right_dtype .kind in "iu"
272+ and left_dtype .kind != right_dtype .kind
273+ ):
274+ raise TypeError (
275+ f"Left and right arrays must have matching signedness. "
276+ f"Got { left_dtype } and { right_dtype } ."
277+ )
278+
266279 if verify_integrity :
267280 cls ._validate (left , right , dtype = dtype )
268281
@@ -536,19 +549,6 @@ def from_arrays(
536549 left = _maybe_convert_platform_interval (left )
537550 right = _maybe_convert_platform_interval (right )
538551
539- # Check for mismatched signed/unsigned integer dtypes
540- left_dtype = left .dtype
541- right_dtype = right .dtype
542- if (
543- left_dtype .kind in "iu"
544- and right_dtype .kind in "iu"
545- and left_dtype .kind != right_dtype .kind
546- ):
547- raise TypeError (
548- f"Left and right arrays must have matching signedness. "
549- f"Got { left_dtype } and { right_dtype } ."
550- )
551-
552552 left , right , dtype = cls ._ensure_simple_new_inputs (
553553 left ,
554554 right ,
You can’t perform that action at this time.
0 commit comments