Casting pl.Categorical("physical") to pl.Categorical("lexical") doesn't invalidate sortedness flag #20864
Open
2 tasks done
Labels
A-dtype-categorical
Area: categorical data type
accepted
Ready for implementation
bug
Something isn't working
P-high
Priority: high
python
Related to Python Polars
Checks
Reproducible example
Log output
Issue description
In this example data should be sorted
s: [a, b]
but it is sorteds: [b, a]
.Seems that polars remembers that
sorted_physically
is already sorted and doesn't sort it after it has been casted.The issue has been introduced sometime between 1.18 and 1.19
Expected behavior
Data should be sorted
s: [a, b]
but it is sorteds: [b, a]
.Installed versions
The text was updated successfully, but these errors were encountered: