Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable dask dispatch to cuDF's is_categorical_dtype for cuDF objects #7740

Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion python/dask_cudf/dask_cudf/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@

from dask.dataframe.categorical import categorical_dtype_dispatch
from dask.dataframe.core import get_parallel_type, make_meta, meta_nonempty
from dask.dataframe.methods import concat_dispatch, tolist_dispatch
from dask.dataframe.methods import (
concat_dispatch,
is_categorical_dtype_dispatch,
tolist_dispatch,
)
from dask.dataframe.utils import (
UNKNOWN_CATEGORIES,
_nonempty_scalar,
Expand Down Expand Up @@ -220,6 +224,13 @@ def tolist_cudf(obj):
return obj.to_arrow().to_pylist()


@is_categorical_dtype_dispatch.register(
(cudf.Series, cudf.Index, cudf.CategoricalDtype, Series)
)
def is_categorical_dtype_cudf(obj):
return cudf.utils.dtypes.is_categorical_dtype(obj)


try:

from dask.dataframe.utils import group_split_dispatch, hash_object_dispatch
Expand Down