Skip to content

Commit

Permalink
test: streaming produce empty frame (#5529)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Nov 16, 2022
1 parent 49ae581 commit c876500
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions py-polars/tests/unit/test_predicates.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import typing
from datetime import date, datetime, timedelta

import polars as pl
Expand Down Expand Up @@ -79,3 +80,17 @@ def test_predicate_null_block_asof_join() -> None:
],
"value": ["a", "b", "c"],
}


@typing.no_type_check
def test_streaming_empty_df() -> None:
df = pl.DataFrame(
[
pl.Series("a", ["a", "b", "c", "b", "a", "a"], dtype=pl.Categorical()),
pl.Series("b", ["b", "c", "c", "b", "a", "c"], dtype=pl.Categorical()),
]
)

assert df.lazy().join(df.lazy(), on="a", how="inner").filter(
2 == 1 # noqa: SIM300
).collect().to_dict(False) == {"a": [], "b": [], "b_right": []}

0 comments on commit c876500

Please sign in to comment.