File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments