|
27 | 27 | is_string_dtype,
|
28 | 28 | is_timedelta64_dtype)
|
29 | 29 | from pandas.core.dtypes.generic import (
|
30 |
| - ABCIndex, ABCSeries, ABCPeriodIndex, ABCIndexClass, ABCDateOffset) |
| 30 | + ABCIndex, ABCSeries, ABCPeriodIndex, ABCIndexClass) |
31 | 31 | from pandas.core.dtypes.missing import isna
|
32 | 32 | from pandas.core import common as com, algorithms
|
33 | 33 | from pandas.core.algorithms import checked_add_with_arr
|
@@ -655,13 +655,14 @@ def _add_datetimelike_methods(cls):
|
655 | 655 | def __add__(self, other):
|
656 | 656 | from pandas.core.index import Index
|
657 | 657 | from pandas.core.indexes.timedeltas import TimedeltaIndex
|
| 658 | + from pandas.tseries.offsets import DateOffset |
658 | 659 |
|
659 | 660 | other = lib.item_from_zerodim(other)
|
660 | 661 | if isinstance(other, ABCSeries):
|
661 | 662 | return NotImplemented
|
662 | 663 | elif is_timedelta64_dtype(other):
|
663 | 664 | return self._add_delta(other)
|
664 |
| - elif isinstance(other, (ABCDateOffset, timedelta)): |
| 665 | + elif isinstance(other, (DateOffset, timedelta)): |
665 | 666 | return self._add_delta(other)
|
666 | 667 | elif is_offsetlike(other):
|
667 | 668 | # Array/Index of DateOffset objects
|
@@ -696,13 +697,14 @@ def __sub__(self, other):
|
696 | 697 | from pandas.core.index import Index
|
697 | 698 | from pandas.core.indexes.datetimes import DatetimeIndex
|
698 | 699 | from pandas.core.indexes.timedeltas import TimedeltaIndex
|
| 700 | + from pandas.tseries.offsets import DateOffset |
699 | 701 |
|
700 | 702 | other = lib.item_from_zerodim(other)
|
701 | 703 | if isinstance(other, ABCSeries):
|
702 | 704 | return NotImplemented
|
703 | 705 | elif is_timedelta64_dtype(other):
|
704 | 706 | return self._add_delta(-other)
|
705 |
| - elif isinstance(other, (ABCDateOffset, timedelta)): |
| 707 | + elif isinstance(other, (DateOffset, timedelta)): |
706 | 708 | return self._add_delta(-other)
|
707 | 709 | elif is_offsetlike(other):
|
708 | 710 | # Array/Index of DateOffset objects
|
|
0 commit comments