Skip to content

Commit 5feb3a6

Browse files
committed
import outside top-level to handle DatetimeArray initialization
1 parent ca071a5 commit 5feb3a6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pandas/core/arrays/datetimelike.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,6 +1495,8 @@ def __rsub__(self, other):
14951495
return (-self) + other
14961496

14971497
# We get here with e.g. datetime objects
1498+
from pandas.core.arrays import DatetimeArray
1499+
14981500
datetime_result = self - other
14991501
if isinstance(datetime_result, DatetimeArray):
15001502
raise TypeError(

0 commit comments

Comments
 (0)