Skip to content

Commit 8992100

Browse files
committed
test_union_same_type mixed int string
1 parent af140a8 commit 8992100

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

after.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
FAILED pandas/tests/indexes/test_numpy_compat.py::test_numpy_ufuncs_reductions[mixed-int-string-maximum] - TypeError: '>=' not supported between instances of 'int' and 'str'
33
FAILED pandas/tests/indexes/test_numpy_compat.py::test_numpy_ufuncs_reductions[mixed-int-string-minimum] - TypeError: '<=' not supported between instances of 'int' and 'str'
4-
FAILED pandas/tests/indexes/test_old_base.py::TestBase::test_argsort[mixed-int-string] - TypeError: '<' not supported between instances of 'str' and 'int'
5-
FAILED pandas/tests/indexes/test_old_base.py::TestBase::test_numpy_argsort[mixed-int-string] - TypeError: '<' not supported between instances of 'str' and 'int'
4+
DONE FAILED pandas/tests/indexes/test_old_base.py::TestBase::test_argsort[mixed-int-string] - TypeError: '<' not supported between instances of 'str' and 'int'
5+
DONE FAILED pandas/tests/indexes/test_old_base.py::TestBase::test_numpy_argsort[mixed-int-string] - TypeError: '<' not supported between instances of 'str' and 'int'
66
FAILED pandas/tests/indexes/test_setops.py::test_union_same_types[mixed-int-string] - TypeError: '<' not supported between instances of 'str' and 'int'
77
FAILED pandas/tests/indexes/test_setops.py::test_union_different_types[mixed-int-string] - TypeError: '<' not supported between instances of 'str' and 'int'
88
FAILED pandas/tests/indexes/test_setops.py::TestSetOps::test_union_base[mixed-int-string] - TypeError: '<' not supported between instances of 'str' and 'int'
@@ -20,4 +20,7 @@ FAILED pandas/tests/indexes/test_setops.py::TestSetOps::test_intersect_unequal[m
2020

2121

2222

23+
24+
25+
2326
================================================ 32 failed, 16436 passed, 221 skipped, 51 xfailed, 3 xpassed in 37.47s ================================================

pandas/tests/indexes/test_setops.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from datetime import datetime
77
import operator
8-
8+
import pandas as pd
99
import numpy as np
1010
import pytest
1111

@@ -63,12 +63,13 @@ def index_flat2(index_flat):
6363

6464

6565
def test_union_same_types(index):
66-
# Union with a non-unique, non-monotonic index raises error
67-
# Only needed for bool index factory
66+
# mixed int string
67+
if index.equals(pd.Index([0, "a", 1, "b", 2, "c"])):
68+
index = index.astype(str)
69+
6870
idx1 = index.sort_values()
6971
idx2 = index.sort_values()
70-
assert idx1.union(idx2).dtype == idx1.dtype
71-
72+
assert idx1.union(idx2, sort=False).dtype == idx1.dtype
7273

7374
def test_union_different_types(index_flat, index_flat2, request):
7475
# This test only considers combinations of indices

0 commit comments

Comments
 (0)