Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Mar 18, 2024
1 parent 60b76a7 commit 5ddbed0
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions py-polars/tests/unit/streaming/test_streaming_group_by.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,3 +453,30 @@ def test_streaming_group_null_count() -> None:
assert df.group_by("g").agg(pl.col("a").count()).collect(streaming=True).to_dict(
as_series=False
) == {"g": [1], "a": [3]}


def test_streaming_groupby_binary_15116() -> None:
assert (
pl.LazyFrame(
{
"str": [
"A",
"A",
"BB",
"BB",
"CCCC",
"CCCC",
"DDDDDDDD",
"DDDDDDDD",
"EEEEEEEEEEEEEEEE",
"A",
]
}
)
.select([pl.col("str").cast(pl.Binary)])
.group_by(["str"])
.agg([pl.len().alias("count")])
).sort("str").collect(streaming=True).to_dict(as_series=False) == {
"str": [b"A", b"BB", b"CCCC", b"DDDDDDDD", b"EEEEEEEEEEEEEEEE"],
"count": [3, 2, 2, 2, 1],
}

0 comments on commit 5ddbed0

Please sign in to comment.