Skip to content

Commit f6726f1

Browse files
committed
add test for isin for filtering with mixed types
1 parent 3377a6d commit f6726f1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pandas/tests/series/methods/test_isin.py

+13
Original file line numberDiff line numberDiff line change
@@ -220,3 +220,16 @@ def test_isin_complex_numbers(array, expected):
220220
# GH 17927
221221
result = Series(array).isin([1j, 1 + 1j, 1 + 2j])
222222
tm.assert_series_equal(result, expected)
223+
224+
225+
@pytest.mark.parametrize(
226+
"data,is_in",
227+
[([1, [2]], [1]), (["simple str", [{"values": 3}]], ["simple str"])],
228+
)
229+
def test_isin_filtering_with_mixed_object_types(data, is_in):
230+
231+
ser = Series(data)
232+
result = ser.isin(is_in)
233+
expected = Series([True, False])
234+
235+
tm.assert_series_equal(result, expected)

0 commit comments

Comments
 (0)