Skip to content

Commit 8698cb2

Browse files
committed
Merge branch 'fix_61188' of https://github.com/Mohit-Kundu/pandas into fix_61188
2 parents 9574fd3 + 3c47323 commit 8698cb2

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

doc/source/whatsnew/v3.0.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,8 +641,8 @@ Categorical
641641

642642
Datetimelike
643643
^^^^^^^^^^^^
644-
- Bug in :attr:`is_year_start` where a DateTimeIndex constructed via a date_range with frequency 'MS' wouldn't have the correct year or quarter start attributes (:issue:`57377`)
645644
- Bug in :attr:`Series.dt.date` where Series with all NaT values would raise an error when compared to a datetime.date (:issue:`61188`)
645+
- Bug in :attr:`is_year_start` where a DateTimeIndex constructed via a date_range with frequency 'MS' wouldn't have the correct year or quarter start attributes (:issue:`57377`)
646646
- Bug in :class:`DataFrame` raising ``ValueError`` when ``dtype`` is ``timedelta64`` and ``data`` is a list containing ``None`` (:issue:`60064`)
647647
- Bug in :class:`Timestamp` constructor failing to raise when ``tz=None`` is explicitly specified in conjunction with timezone-aware ``tzinfo`` or data (:issue:`48688`)
648648
- Bug in :func:`date_range` where the last valid timestamp would sometimes not be produced (:issue:`56134`)

pandas/core/indexes/accessors.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,7 @@ def _delegate_property_get(self, name: str):
109109
index = self._parent.index
110110
# return the result as a Series
111111
return Series(
112-
result,
113-
index=index,
114-
name=self.name,
115-
dtype=result.dtype
112+
result, index=index, name=self.name, dtype=result.dtype
116113
).__finalize__(self._parent)
117114

118115
def _delegate_property_set(self, name: str, value, *args, **kwargs) -> NoReturn:

pandas/tests/series/indexing/test_datetime.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ def test_compare_datetime_with_all_none():
492492
expected = Series([False, False])
493493
tm.assert_series_equal(result, expected)
494494

495+
495496
def test_dt_date_dtype_all_nat_is_object():
496497
# Ensure .dt.date on all-NaT Series returns object dtype and not datetime64
497498
# GH#61188
@@ -503,8 +504,9 @@ def test_dt_date_dtype_all_nat_is_object():
503504

504505
tm.assert_series_equal(result, expected)
505506

507+
506508
def test_dt_date_all_nat_le_date():
507-
#All-NaT Series should not raise error when compared to a datetime.date
509+
# All-NaT Series should not raise error when compared to a datetime.date
508510
# GH#61188
509511
s = Series([pd.NaT, pd.NaT])
510512
s = pd.to_datetime(s)

0 commit comments

Comments
 (0)