Unordered enum data type #16699
Labels
A-dtype-categorical
Area: categorical data type
accepted
Ready for implementation
enhancement
New feature or an improvement of an existing feature
Description
Following on from suggestion in #16689
Add a boolean parameter
ordered
topolars.Enum
to allow for evaluating Enums irrespective of their category order.The following should raise no errors:
Example use case - unit testing
The intended purpose is to allow for defining an unordered
pl.Enum
in unit tests which can be used in columns of a DataFrame/LazyFrame supplied topolars.testing.assert_frame_equal
. The idea is that the unit test should check that the correctpl.Enum
is cast to the correct columns without caring about the order of the enum categories defined in the source code.For example, for
my_module
:We could write a unit test:
The text was updated successfully, but these errors were encountered: