Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 748596d

Browse filesBrowse files
committed
fix the unused variable in the test_setops.py
1 parent bcf1e0d commit 748596d
Copy full SHA for 748596d

File tree

Expand file treeCollapse file tree

1 file changed

+19
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+19
-1
lines changed

‎pandas/tests/indexes/multi/test_setops.py

Copy file name to clipboardExpand all lines: pandas/tests/indexes/multi/test_setops.py
+19-1Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff 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

231249
def test_difference_sort_special():

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.