Skip to content

Commit

Permalink
test: Test for unique length on multiple columns (pola-rs#21418)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjpfan authored and anath2 committed Mar 5, 2025
1 parent a9e4a1f commit fafc9ba
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions py-polars/tests/unit/lazyframe/test_lazyframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1488,3 +1488,13 @@ def test_type_coercion_cast_boolean_after_comparison() -> None:
for op in [operator.and_, operator.or_, operator.xor]:
e = op(pl.col("a"), pl.col("b")).cast(pl.Boolean)
assert "cast" in lf.with_columns(e).explain()


def test_unique_length_multiple_columns() -> None:
lf = pl.LazyFrame(
{
"a": [1, 1, 1, 2, 3],
"b": [100, 100, 200, 100, 300],
}
)
assert lf.unique().select(pl.len()).collect().item() == 4

0 comments on commit fafc9ba

Please sign in to comment.