Skip to content

Commit 246eb57

Browse files
Use numpy_array_equal in indexer test
1 parent 0730cd6 commit 246eb57

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

pandas/core/indexes/interval.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -830,9 +830,6 @@ def get_indexer(self, target, method=None, limit=None, tolerance=None):
830830
self._find_non_overlapping_monotonic_bounds()
831831
)
832832
except TypeError:
833-
# This is probably wrong
834-
# but not sure what I should do here
835-
#return np.array([-1])
836833
return np.repeat(np.int(-1), len(target))
837834

838835
start_plus_one = start + 1

pandas/tests/indexes/interval/test_interval.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,8 @@ def test_get_indexer_length_one(self, item, closed):
621621
pd.IntervalIndex.from_tuples([(1, 3), (2, 4), (0, 2)])
622622
])
623623
def test_get_indexer_errors(self, index):
624-
assert np.all(index.get_indexer(['gg']) == np.array([-1]))
624+
expected = np.array([-1], dtype='intp')
625+
assert tm.assert_numpy_array_equal(index.get_indexer(['gg']), expected)
625626

626627
# Make consistent with test_interval_new.py (see #16316, #16386)
627628
@pytest.mark.parametrize('arrays', [

0 commit comments

Comments
 (0)