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

[REVIEW] Revert dask versioning of concat dispatch #7823

Merged
Merged
Changes from all 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
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