Skip to content

Commit

Permalink
add extra test for polars expand
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel.oranyeli committed Jul 19, 2024
1 parent 1e043d9 commit a46c1c8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/polars/functions/test_expand_polars.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,11 @@ def test_expand_1(df):
"""
Test output for janitor.expand.
"""
expected = df.expand("group", "item_id", "item_name", sort=True)
actual = (
df.select(pl.col("group").unique())
.join(df.select(pl.col("item_id").unique()), how="cross")
.join(df.select(pl.col("item_name").unique()), how="cross")
.sort(by=pl.all())
)
assert_frame_equal(actual, expected)

0 comments on commit a46c1c8

Please sign in to comment.