Skip to content

Commit

Permalink
revert dask version of concat dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
galipremsagar committed Apr 1, 2021
1 parent e7153bb commit 298e429
Showing 1 changed file with 19 additions and 42 deletions.
61 changes: 19 additions & 42 deletions python/dask_cudf/dask_cudf/backends.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# Copyright (c) 2020-2021, NVIDIA CORPORATION.

from distutils.version import LooseVersion

import cupy as cp
import numpy as np
import pandas as pd
import pyarrow as pa

import dask
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 (
Expand All @@ -31,7 +28,6 @@
get_parallel_type.register(cudf.DataFrame, lambda _: DataFrame)
get_parallel_type.register(cudf.Series, lambda _: Series)
get_parallel_type.register(cudf.Index, lambda _: Index)
DASK_VERSION = LooseVersion(dask.__version__)


@meta_nonempty.register(cudf.Index)
Expand Down Expand Up @@ -205,45 +201,26 @@ def make_meta_object(x, index=None):
raise TypeError(f"Don't know how to create metadata from {x}")


if DASK_VERSION > "2021.03.1":

@concat_dispatch.register((cudf.DataFrame, cudf.Series, cudf.Index))
def concat_cudf(
dfs,
axis=0,
join="outer",
uniform=False,
filter_warning=True,
sort=None,
ignore_index=False,
**kwargs,
):
assert join == "outer"

ignore_order = kwargs.get("ignore_order", False)
if ignore_order:
raise NotImplementedError(
"ignore_order parameter is not yet supported in dask-cudf"
)

return cudf.concat(dfs, axis=axis, ignore_index=ignore_index)


else:

@concat_dispatch.register((cudf.DataFrame, cudf.Series, cudf.Index))
def concat_cudf(
dfs,
axis=0,
join="outer",
uniform=False,
filter_warning=True,
sort=None,
ignore_index=False,
):
assert join == "outer"
@concat_dispatch.register((cudf.DataFrame, cudf.Series, cudf.Index))
def concat_cudf(
dfs,
axis=0,
join="outer",
uniform=False,
filter_warning=True,
sort=None,
ignore_index=False,
**kwargs,
):
assert join == "outer"

ignore_order = kwargs.get("ignore_order", False)
if ignore_order:
raise NotImplementedError(
"ignore_order parameter is not yet supported in dask-cudf"
)

return cudf.concat(dfs, axis=axis, ignore_index=ignore_index)
return cudf.concat(dfs, axis=axis, ignore_index=ignore_index)


@categorical_dtype_dispatch.register((cudf.DataFrame, cudf.Series, cudf.Index))
Expand Down

0 comments on commit 298e429

Please sign in to comment.