Skip to content

Commit f768a2f

Browse files
committed
mypy fixup
1 parent 773351a commit f768a2f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

pandas/core/arrays/datetimelike.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2144,7 +2144,7 @@ def unit(self) -> TimeUnit:
21442144
# "ExtensionDtype"; expected "Union[DatetimeTZDtype, dtype[Any]]"
21452145
return dtype_to_unit(self.dtype) # type: ignore[arg-type]
21462146

2147-
def as_unit(self, unit: str, round_ok: bool = True) -> Self:
2147+
def as_unit(self, unit: TimeUnit, round_ok: bool = True) -> Self:
21482148
"""
21492149
Convert to a dtype with the given unit resolution.
21502150

pandas/core/arrays/datetimes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ def _unbox_scalar(self, value) -> np.datetime64:
535535
raise ValueError("'value' should be a Timestamp.")
536536
self._check_compatible_with(value)
537537
if value is NaT:
538-
return np.datetime64(value._value, self.unit) # type: ignore[call-overload]
538+
return np.datetime64(value._value, self.unit)
539539
else:
540540
return value.as_unit(self.unit, round_ok=False).asm8
541541

pandas/core/arrays/timedeltas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def _unbox_scalar(self, value) -> np.timedelta64:
325325
raise ValueError("'value' should be a Timedelta.")
326326
self._check_compatible_with(value)
327327
if value is NaT:
328-
return np.timedelta64(value._value, self.unit) # type: ignore[call-overload]
328+
return np.timedelta64(value._value, self.unit)
329329
else:
330330
return value.as_unit(self.unit, round_ok=False).asm8
331331

0 commit comments

Comments
 (0)