File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 7171
7272from pandas .tseries .frequencies import get_period_alias
7373from pandas .tseries .offsets import (
74- DateOffset as TSeriesDateOffset ,
74+ BusinessDay ,
75+ DateOffset ,
7576 Day ,
7677 Tick ,
7778)
@@ -825,14 +826,18 @@ def _add_offset(self, offset: BaseOffset) -> Self:
825826 "s" ,
826827 ]
827828 res_unit = self .unit
828- if isinstance (offset , TSeriesDateOffset ):
829+ if type (offset ) is DateOffset :
830+ nano = offset .kwds .get ("nanoseconds" , 0 )
829831 micro = offset .kwds .get ("microseconds" , 0 )
830- if micro and self .unit != "ns" :
832+ if nano :
833+ res_unit = "ns"
834+ elif micro and self .unit != "ns" :
831835 res_unit = "us"
832836 if (
833837 hasattr (offset , "offset" )
834838 and offset .offset is not None
835839 and not isinstance (offset , Tick )
840+ and type (offset ) is not BusinessDay
836841 ):
837842 offset_td = Timedelta (offset .offset )
838843 if offset_td .value != 0 :
You can’t perform that action at this time.
0 commit comments