Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
c-peters committed Jun 18, 2024
1 parent 82a5ec6 commit 91c1ea4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions py-polars/tests/unit/datatypes/test_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,3 +831,16 @@ def test_cat_append_lexical_sorted_flag() -> None:
df2 = pl.concat([part.sort("y") for part in df.partition_by("x")])

assert not (df2["y"].is_sorted())


def test_get_cat_categories_multiple_chunks() -> None:
df = pl.DataFrame(
[
pl.Series("e", ["a", "b"], pl.Enum(["a", "b"])),
]
)
df = pl.concat(
[df for _ in range(100)], how="vertical", rechunk=False, parallel=True
)
df_cat = df.lazy().select(pl.col("e").cat.get_categories()).collect()
assert len(df_cat) == 2

0 comments on commit 91c1ea4

Please sign in to comment.