Skip to content

Commit

Permalink
Add backend for percentile_lookup dispatch (#9118)
Browse files Browse the repository at this point in the history
This PR adds backend for `percentile_lookup` dispatch in `dask_cudf`, related dask upstream changes were done in dask/dask#8083

Authors:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

Approvers:
  - https://github.com/jakirkham

URL: #9118
  • Loading branch information
galipremsagar authored Aug 26, 2021
1 parent 40cad38 commit 0ad36ff
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/dask_cudf/dask_cudf/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,14 @@ def is_categorical_dtype_cudf(obj):


try:
from dask.dataframe.dispatch import percentile_dispatch
try:
from dask.array.dispatch import percentile_lookup
except ImportError:
from dask.dataframe.dispatch import (
percentile_dispatch as percentile_lookup,
)

@percentile_dispatch.register((cudf.Series, cp.ndarray, cudf.Index))
@percentile_lookup.register((cudf.Series, cp.ndarray, cudf.Index))
def percentile_cudf(a, q, interpolation="linear"):
# Cudf dispatch to the equivalent of `np.percentile`:
# https://numpy.org/doc/stable/reference/generated/numpy.percentile.html
Expand Down

0 comments on commit 0ad36ff

Please sign in to comment.