isin on object-dtype columns coerces to strings: isin(['1']) matches the integer 1 (pandas does not), isin([1]) misses it
Author: ptimizeroracleCreated Sep 28, 2026Updated Sep 28, 2026
Labelsneeds triage
Series.isin on an object-dtype column with mixed python types gives different results in dask vs pandas: dask appears to compare after string coercion
import pandas as pd
import dask.dataframe as dd
s = ["1", 1, None]
print(pd.Series(s).isin([1]).tolist())
# [False, True, False] - the int row matches
print(dd.from_pandas(pd.Series(s), npartitions=1).isin([1]).compute().tolist())
# [False, False, False] - the int row no longer matches
print(pd.Series(["1", 1]).isin(["1"]).tolist())
# [True, False]
print(dd.from_pandas(pd.Series(["1", 1]), npartitions=1).isin(["1"]).compute().tolist())
# [True, True] - the integer matches a string needleso on dask, isin(["1"]) matches an integer 1 (pandas: no), and isin([1]) fails to match it (pandas: yes). the symmetric flip reads like the column values and/or needles are being stringified before comparison (possibly via an arrow-backed conversion of object dtype)
consequence: filters/joins built on isin select different rows in pandas vs dask on the same data, silently. reproducible on dask 2026.8.0 with pandas 3.0.6 (pyarrow installed), both with fresh dd.from_pandas
happy to help dig into the conversion path if useful
Source: dask/dask