Skip to content

Commit

Permalink
BUG: Used getattr for nano check pandas-dev#47856
Browse files Browse the repository at this point in the history
  • Loading branch information
KingOfTheShow69 committed Aug 9, 2022
1 parent f7e7dce commit 656a00d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pandas/_libs/tslibs/offsets.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1157,8 +1157,9 @@ cdef class RelativeDeltaOffset(BaseOffset):
return dt64other
elif not self._use_relativedelta and hasattr(self, "_offset"):
# timedelta
if hasattr(self, "nanoseconds"):
rem_nano = Timedelta(nanoseconds=self.nanoseconds)
num_nano = getattr(self, "nanoseconds", 0)
if num_nano != 0:
rem_nano = Timedelta(nanoseconds=num_nano)
delta = Timedelta((self._offset + rem_nano) * self.n)
else:
delta = Timedelta((self._offset) * self.n)
Expand Down

0 comments on commit 656a00d

Please sign in to comment.