File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
pandas/tests/indexes/multi Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -225,7 +225,25 @@ def test_multiindex_difference_pyarrow_timestamp():
225225 # Verify the result
226226 assert len (new_idx ) == 1
227227 assert idx_val not in new_idx
228- assert new_idx .equals (MultiIndex .from_tuples ([(2 , pd .Timestamp ("1900-01-01" ))]))
228+
229+ # Create expected index with the same PyArrow timestamp dtype
230+ expected_df = (
231+ DataFrame (
232+ [(2 , "1900-01-01" , "b" )],
233+ columns = ["id" , "date" , "val" ],
234+ )
235+ .astype (
236+ {
237+ "id" : "int64[pyarrow]" ,
238+ "date" : "timestamp[ns][pyarrow]" ,
239+ "val" : "string[pyarrow]" ,
240+ }
241+ )
242+ .set_index (["id" , "date" ])
243+ )
244+ expected = expected_df .index
245+
246+ assert new_idx .equals (expected )
229247
230248
231249def test_difference_sort_special ():
You can’t perform that action at this time.
0 commit comments