@@ -318,7 +318,7 @@ def _simple_new( # type: ignore[override]
318318 else :
319319 # DatetimeTZDtype. If we have e.g. DatetimeTZDtype[us, UTC],
320320 # then values.dtype should be M8[us].
321- assert dtype ._creso == get_unit_from_dtype (values .dtype )
321+ assert dtype ._creso == get_unit_from_dtype (values .dtype ) # type: ignore[union-attr]
322322
323323 result = super ()._simple_new (values , dtype )
324324 result ._freq = freq
@@ -529,7 +529,7 @@ def _unbox_scalar(self, value) -> np.datetime64:
529529 raise ValueError ("'value' should be a Timestamp." )
530530 self ._check_compatible_with (value )
531531 if value is NaT :
532- return np .datetime64 (value ._value , self .unit )
532+ return np .datetime64 (value ._value , self .unit ) # type: ignore[call-overload]
533533 else :
534534 return value .as_unit (self .unit ).asm8
535535
@@ -803,10 +803,7 @@ def _add_offset(self, offset: BaseOffset) -> Self:
803803 try :
804804 res_values = offset ._apply_array (values ._ndarray )
805805 if res_values .dtype .kind == "i" :
806- # error: Argument 1 to "view" of "ndarray" has incompatible type
807- # "dtype[datetime64] | DatetimeTZDtype"; expected
808- # "dtype[Any] | type[Any] | _SupportsDType[dtype[Any]]"
809- res_values = res_values .view (values .dtype ) # type: ignore[arg-type]
806+ res_values = res_values .view (values .dtype )
810807 except NotImplementedError :
811808 warnings .warn (
812809 "Non-vectorized DateOffset being applied to Series or DatetimeIndex." ,
0 commit comments