Skip to content

Commit 90757dc

Browse files
authored
TST: Add test for isin for filtering with mixed types (#50019)
1 parent 4d16e70 commit 90757dc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pandas/tests/series/methods/test_isin.py

+14
Original file line numberDiff line numberDiff line change
@@ -220,3 +220,17 @@ 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+
# GH 20883
231+
232+
ser = Series(data)
233+
result = ser.isin(is_in)
234+
expected = Series([True, False])
235+
236+
tm.assert_series_equal(result, expected)

0 commit comments

Comments
 (0)