Skip to content

Commit 044610f

Browse files
committed
mypy fixup
1 parent 6e29a86 commit 044610f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pandas/core/arrays/datetimelike.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@
157157
Sequence,
158158
)
159159

160+
from pandas._typing import TimeUnit
161+
160162
from pandas import Index
161163
from pandas.core.arrays import (
162164
DatetimeArray,
@@ -2114,7 +2116,7 @@ def _creso(self) -> int:
21142116
return get_unit_from_dtype(self._ndarray.dtype)
21152117

21162118
@cache_readonly
2117-
def unit(self) -> str:
2119+
def unit(self) -> TimeUnit:
21182120
"""
21192121
The precision unit of the datetime data.
21202122

pandas/core/resample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3095,7 +3095,7 @@ def asfreq(
30953095

30963096
new_obj.index = _asfreq_compat(obj.index, freq)
30973097
else:
3098-
unit = None
3098+
unit: TimeUnit = "ns"
30993099
if isinstance(obj.index, DatetimeIndex):
31003100
# TODO: should we disallow non-DatetimeIndex?
31013101
unit = obj.index.unit

0 commit comments

Comments
 (0)