File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -827,22 +827,17 @@ def _add_offset(self, offset: BaseOffset) -> Self:
827827 if hasattr (offset , "offset" ):
828828 offset_td = Timedelta (offset .offset )
829829 offset_unit = offset_td .unit
830- if self .unit in units and offset_unit in units :
831- idx_self = units .index (self .unit )
832- idx_offset = units .index (offset_unit )
833- res_unit = units [min (idx_self , idx_offset )]
830+ idx_self = units .index (self .unit )
831+ idx_offset = units .index (offset_unit )
832+ res_unit = units [min (idx_self , idx_offset )]
834833 result = type (self )._simple_new (res_values , dtype = res_values .dtype )
835834 result = result .as_unit (res_unit )
836835
837836 if offset .normalize :
838837 result = result .normalize ()
839838 result ._freq = None
840839
841- if (
842- self .tz is not None
843- and getattr (result .dtype , "tz" , None ) is None
844- and res_unit == "ns"
845- ):
840+ if self .tz is not None :
846841 result = result .tz_localize (self .tz )
847842
848843 return result
You can’t perform that action at this time.
0 commit comments