Skip to content

[BUG] Cannot find maxima of a categorical series #15641

@rjzamora

Description

@rjzamora

Describe the bug
While debugging some strange dask-expr + cudf sorting behavior, I realized that I cannot call ser.min() when ser is a categorical Series. This is a problem for the sort_values logic used in dask.

Steps/Code to reproduce bug

import cudf

ser = cudf.Series(range(10), dtype="category")
ser.min()
# Same problem with `ser.cat.as_ordered().min()`
...
TypeError: Cannot interpret 'CategoricalDtype(categories=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], ordered=False, categories_dtype=int64)' as a data type

Expected behavior
I'd expect for min/max to work (assuming the dtype is "ordered").

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions