From cdf77047c6e2f17c478a8569168a09def2c9b135 Mon Sep 17 00:00:00 2001 From: GALI PREM SAGAR Date: Mon, 19 Apr 2021 19:16:38 -0500 Subject: [PATCH] [REVIEW] Fix a `NameError` in meta dispatch API (#7996) This PR fixes an incorrect usage with the correct usage of `column`(`cudf.core.column`). cc: @charlesbluca --- python/dask_cudf/dask_cudf/backends.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/python/dask_cudf/dask_cudf/backends.py b/python/dask_cudf/dask_cudf/backends.py index 0570654fde3..a0f498d2668 100644 --- a/python/dask_cudf/dask_cudf/backends.py +++ b/python/dask_cudf/dask_cudf/backends.py @@ -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 @@ -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): @@ -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))