With the help of claude sonnet 4, I cooked up this function, which I hope does what I asked it to do. def has_duplicates_early_exit(df: pl.LazyFrame, subset: list[str]) -> bool: """Can exit early when first duplicate is found""" return df.select( pl.struct(subset).is_duplicated().any() ).collect().item() Is this the most efficient you can do? Continue reading...