@@ -211,6 +211,24 @@ def test_isin_large_series_mixed_dtypes_and_nan(monkeypatch):
211211 tm .assert_series_equal (result , expected )
212212
213213
214+ @pytest .mark .parametrize ("dtype, data, values, expected" , [
215+ ("boolean" , [pd .NA , False , True ], [False , pd .NA ], [True , True , False ]),
216+ ("Int64" , [pd .NA , 2 , 1 ], [1 , pd .NA ], [True , False , True ]),
217+ ("Float64" , [20.0 , 30.0 , pd .NA ], [pd .NA ], [False , False , True ])
218+ ])
219+ def test_isin_large_series_and_pdNA (dtype , data , values , expected , monkeypatch ):
220+ # https://github.com/pandas-dev/pandas/issues/60678
221+ # combination of large series (> _MINIMUM_COMP_ARR_LEN elements) and
222+ # values contains pdNA
223+ min_isin_comp = 2
224+ ser = Series (data , dtype = dtype )
225+ expected = pd .Series (expected , dtype = "boolean" )
226+
227+ with monkeypatch .context () as m :
228+ m .setattr (algorithms , "_MINIMUM_COMP_ARR_LEN" , min_isin_comp )
229+ result = ser .isin (values )
230+ tm .assert_series_equal (result , expected )
231+
214232def test_isin_complex_numbers ():
215233 # GH 17927
216234 array = [0 , 1j , 1j , 1 , 1 + 1j , 1 + 2j , 1 + 1j ]
0 commit comments