Skip to content

Commit 78672ae

Browse files
committed
fix mypy
1 parent bbf9462 commit 78672ae

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/system/small/test_index.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,15 @@ def test_get_loc_should_return_mask_for_non_monotonic_duplicates():
7474
bf_index = bpd.Index(["a", "b", "c", "b"])
7575
pd_index = pd.Index(["a", "b", "c", "b"])
7676

77+
pd_result = pd_index.get_loc("b")
7778
bf_result = bf_index.get_loc("b")
79+
80+
assert not isinstance(bf_result, (int, slice))
81+
7882
if hasattr(bf_result, "to_numpy"):
7983
bf_array = bf_result.to_numpy()
8084
else:
8185
bf_array = bf_result.to_pandas().to_numpy()
82-
pd_result = pd_index.get_loc("b")
83-
8486
numpy.testing.assert_array_equal(bf_array, pd_result)
8587

8688

@@ -89,13 +91,15 @@ def test_get_loc_should_return_mask_for_non_monotonic_numeric_duplicates():
8991
bf_index = bpd.Index([1, 2, 3, 2])
9092
pd_index = pd.Index([1, 2, 3, 2])
9193

94+
pd_result = pd_index.get_loc(2)
9295
bf_result = bf_index.get_loc(2)
96+
97+
assert not isinstance(bf_result, (int, slice))
98+
9399
if hasattr(bf_result, "to_numpy"):
94100
bf_array = bf_result.to_numpy()
95101
else:
96102
bf_array = bf_result.to_pandas().to_numpy()
97-
pd_result = pd_index.get_loc(2)
98-
99103
numpy.testing.assert_array_equal(bf_array, pd_result)
100104

101105

0 commit comments

Comments
 (0)