Skip to content

Commit 5a7b312

Browse files
committed
put back code in core/arrays/datetimes.py
1 parent 9d22a77 commit 5a7b312

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pandas/core/arrays/datetimes.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,9 @@ def _add_offset(self, offset) -> DatetimeArray:
775775
def _sub_datetimelike_scalar(self, other):
776776
# subtract a datetime from myself, yielding a ndarray[timedelta64[ns]]
777777
assert isinstance(other, (datetime, np.datetime64))
778+
# error: Non-overlapping identity check (left operand type: "Union[datetime,
779+
# datetime64]", right operand type: "NaTType") [comparison-overlap]
780+
assert other is not NaT # type: ignore[comparison-overlap]
778781
other = Timestamp(other)
779782
# error: Non-overlapping identity check (left operand type: "Timestamp",
780783
# right operand type: "NaTType")

0 commit comments

Comments
 (0)