Skip to content

Commit 3068949

Browse files
committed
whatsnew note, requested comment edits
1 parent 9c5e0de commit 3068949

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

doc/source/whatsnew/v0.23.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ Other API Changes
332332
- Subtracting ``NaT`` from a :class:`Series` with ``dtype='datetime64[ns]'`` returns a ``Series`` with ``dtype='timedelta64[ns]'`` instead of ``dtype='datetime64[ns]'``(:issue:`18808`)
333333
- Operations between a :class:`Series` with dtype ``dtype='datetime64[ns]'`` and a :class:`PeriodIndex` will correctly raises ``TypeError`` (:issue:`18850`)
334334
- Subtraction of :class:`Series` with timezone-aware ``dtype='datetime64[ns]'`` with mis-matched timezones will raise ``TypeError`` instead of ``ValueError`` (issue:`18817`)
335+
- Comparing :class:`Series` with ``dtype='datetime64[ns]'`` with ``datetime.date`` objects will raise a ``TypeError`` for comparisons other than ``==`` and ``!=``. This ensures that ``Series`` behavior matches ``DatetimeIndex`` and ``Timestamp`` behavior (:issue:`19524`)
335336
- :class:`IntervalIndex` and ``IntervalDtype`` no longer support categorical, object, and string subtypes (:issue:`19016`)
336337
- The default ``Timedelta`` constructor now accepts an ``ISO 8601 Duration`` string as an argument (:issue:`19040`)
337338
- ``IntervalDtype`` now returns ``True`` when compared against ``'interval'`` regardless of subtype, and ``IntervalDtype.name`` now returns ``'interval'`` regardless of subtype (:issue:`18980`)

pandas/core/ops.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -789,8 +789,8 @@ def wrapper(self, other, axis=None):
789789
return NotImplemented
790790

791791
elif isinstance(other, ABCSeries) and not self._indexed_same(other):
792-
raise ValueError('Can only compare identically-labeled Series '
793-
'objects')
792+
raise ValueError('Can only compare identically-labeled '
793+
'Series objects')
794794

795795
elif is_datetime64_dtype(self) or is_datetime64tz_dtype(self):
796796
res_values = dispatch_to_index_op(op, self, other,
@@ -807,7 +807,7 @@ def wrapper(self, other, axis=None):
807807
dtype=res_values.dtype)
808808

809809
elif isinstance(other, ABCSeries):
810-
# By this point we know that self._indexed_same(other)
810+
# By this point, we know that self._indexed_same(other)
811811
res_values = na_op(self.values, other.values)
812812
return self._constructor(res_values, index=self.index,
813813
name=res_name)

0 commit comments

Comments
 (0)