Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Oct 1, 2024
1 parent 018ec08 commit f3f727d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions py-polars/polars/testing/parametric/strategies/dtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,9 @@ def _time_zones() -> SearchStrategy[str]:
)


def _categorical_orderings() -> SearchStrategy[CategoricalOrdering]:
def _categorical_orderings() -> SearchStrategy[CategoricalOrdering | None]:
"""Create a strategy for generating valid ordering types for categorical data."""
return st.sampled_from(["physical", "lexical"])
return st.sampled_from([None, "lexical"])


@st.composite
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import warnings

import pytest

import polars as pl
Expand Down Expand Up @@ -146,5 +148,6 @@ def test_cat_uses_lexical_ordering() -> None:
s = s.cast(pl.Categorical("lexical"))
assert s.cat.uses_lexical_ordering() is True

s = s.cast(pl.Categorical("physical"))
assert s.cat.uses_lexical_ordering() is False
with warnings.catch_warnings():
s = s.cast(pl.Categorical("physical"))
assert s.cat.uses_lexical_ordering() is False

0 comments on commit f3f727d

Please sign in to comment.