File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 77import re
88
99import numpy as np
10+ import pyarrow as pa
1011import pytest
1112
1213from pandas ._libs import iNaT
@@ -1887,6 +1888,10 @@ def test_datetime_indexer_consistency_pyarrow_date32():
18871888 ser3 = ser .astype ("datetime64[ns]" )
18881889 dti = Index (ser3 )
18891890
1891+ # Make sure we don't treat Arrow date as timestamp
1892+ dtype = ser .dtype .arrow_dtype
1893+ assert not (dtype .kind == "M" and not pa .types .is_date (dtype ))
1894+
18901895 with pytest .raises (KeyError ):
18911896 dti .get_loc (ser [0 ])
18921897
Original file line number Diff line number Diff line change @@ -758,6 +758,8 @@ def test_datetime_understood(self, unit):
758758 tm .assert_series_equal (result , expected )
759759
760760 def test_align_date_objects_with_datetimeindex (self ):
761+ # GH#62158: v3.0.0 - DatetimeIndex no longer matches Python date labels.
762+ # The result is always all-NaN and the union index.
761763 rng = date_range ("1/1/2000" , periods = 20 )
762764 ts = Series (np .random .default_rng (2 ).standard_normal (20 ), index = rng )
763765
@@ -769,7 +771,7 @@ def test_align_date_objects_with_datetimeindex(self):
769771 result2 = ts2 + ts
770772
771773 date_labels = [x .date () for x in rng [5 :]]
772- expected_index = Index (date_labels + list (rng ), dtype = object )
774+ expected_index = Index (list (rng ) + date_labels , dtype = object )
773775
774776 # Length and index checks
775777 assert len (result ) == 35
You can’t perform that action at this time.
0 commit comments