Skip to content

Commit a7d7d18

Browse files
authored
TST #28981 comparison operation for interval dtypes (#34443)
1 parent 639e3db commit a7d7d18

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/tests/arithmetic/test_interval.py

+8
Original file line numberDiff line numberDiff line change
@@ -284,3 +284,11 @@ def test_index_series_compat(self, op, constructor, expected_type, assert_func):
284284
result = op(index, other)
285285
expected = expected_type(self.elementwise_comparison(op, index, other))
286286
assert_func(result, expected)
287+
288+
@pytest.mark.parametrize("scalars", ["a", False, 1, 1.0, None])
289+
def test_comparison_operations(self, scalars):
290+
# GH #28981
291+
expected = Series([False, False])
292+
s = pd.Series([pd.Interval(0, 1), pd.Interval(1, 2)], dtype="interval")
293+
result = s == scalars
294+
tm.assert_series_equal(result, expected)

0 commit comments

Comments
 (0)