Skip to content

Commit

Permalink
Merge pull request #7999 from rapidsai/branch-0.19
Browse files Browse the repository at this point in the history
[gpuCI] Forward-merge branch-0.19 to branch-0.20 [skip ci]
  • Loading branch information
GPUtester authored Apr 20, 2021
2 parents 68495f9 + cdf7704 commit 2214407
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions python/dask_cudf/dask_cudf/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,20 @@ def _get_non_empty_data(s):
if len(s._column.categories)
else [UNKNOWN_CATEGORIES]
)
codes = column.full(size=2, fill_value=0, dtype="int32")
codes = cudf.core.column.full(size=2, fill_value=0, dtype="int32")
ordered = s._column.ordered
data = column.build_categorical_column(
data = cudf.core.column.build_categorical_column(
categories=categories, codes=codes, ordered=ordered
)
elif is_string_dtype(s.dtype):
data = pa.array(["cat", "dog"])
else:
if pd.api.types.is_numeric_dtype(s.dtype):
data = column.as_column(cp.arange(start=0, stop=2, dtype=s.dtype))
data = cudf.core.column.as_column(
cp.arange(start=0, stop=2, dtype=s.dtype)
)
else:
data = column.as_column(
data = cudf.core.column.as_column(
cp.arange(start=0, stop=2, dtype="int64")
).astype(s.dtype)
return data
Expand Down Expand Up @@ -244,8 +246,6 @@ def is_categorical_dtype_cudf(obj):

from dask.dataframe.utils import group_split_dispatch, hash_object_dispatch

from cudf.core.column import column

def safe_hash(frame):
index = frame.index
if isinstance(frame, cudf.DataFrame):
Expand All @@ -265,7 +265,7 @@ def hash_object_cudf_index(ind, index=None):
if isinstance(ind, cudf.MultiIndex):
return safe_hash(ind.to_frame(index=False))

col = column.as_column(ind)
col = cudf.core.column.as_column(ind)
return safe_hash(cudf.Series(col))

@group_split_dispatch.register((cudf.Series, cudf.DataFrame))
Expand Down

0 comments on commit 2214407

Please sign in to comment.