From 7c8d84700cfa68d1ce24c9d7af7fe4bfcaaa90d3 Mon Sep 17 00:00:00 2001 From: GALI PREM SAGAR Date: Tue, 15 Jun 2021 16:36:29 -0500 Subject: [PATCH] Fix importing `apply` from `dask` (#8517) As part of https://github.com/dask/dask/pull/7801/, `apply` has been removed from `dask.compatibility`, hence made changes in `dask_cudf` to import `apply` from `dask.utils`, this change is back-ward compatible to older versions of dask too. Authors: - GALI PREM SAGAR (https://github.com/galipremsagar) Approvers: - Benjamin Zaitlen (https://github.com/quasiben) - https://github.com/jakirkham - AJ Schmidt (https://github.com/ajschmidt8) URL: https://github.com/rapidsai/cudf/pull/8517 --- ci/benchmark/build.sh | 8 ++++---- ci/gpu/build.sh | 4 ++-- conda/environments/cudf_dev_cuda11.0.yml | 4 ++-- conda/environments/cudf_dev_cuda11.2.yml | 4 ++-- conda/recipes/dask-cudf/run_test.sh | 8 ++++---- python/dask_cudf/dask_cudf/core.py | 3 +-- python/dask_cudf/dask_cudf/io/csv.py | 3 +-- 7 files changed, 16 insertions(+), 18 deletions(-) diff --git a/ci/benchmark/build.sh b/ci/benchmark/build.sh index 07d6a0e50af..035c89f8bcc 100755 --- a/ci/benchmark/build.sh +++ b/ci/benchmark/build.sh @@ -75,10 +75,10 @@ conda install "rmm=$MINOR_VERSION.*" "cudatoolkit=$CUDA_REL" \ # conda install "your-pkg=1.0.0" # Install the master version of dask, distributed, and streamz -logger "pip install git+https://github.com/dask/distributed.git@main --upgrade --no-deps" -pip install "git+https://github.com/dask/distributed.git@main" --upgrade --no-deps -logger "pip install git+https://github.com/dask/dask.git@main --upgrade --no-deps" -pip install "git+https://github.com/dask/dask.git@main" --upgrade --no-deps +logger "pip install git+https://github.com/dask/distributed.git@2021.06.0 --upgrade --no-deps" +pip install "git+https://github.com/dask/distributed.git@2021.06.0" --upgrade --no-deps +logger "pip install git+https://github.com/dask/dask.git@2021.06.0 --upgrade --no-deps" +pip install "git+https://github.com/dask/dask.git@2021.06.0" --upgrade --no-deps logger "pip install git+https://github.com/python-streamz/streamz.git --upgrade --no-deps" pip install "git+https://github.com/python-streamz/streamz.git" --upgrade --no-deps diff --git a/ci/gpu/build.sh b/ci/gpu/build.sh index d88fe837103..8299afa18a9 100755 --- a/ci/gpu/build.sh +++ b/ci/gpu/build.sh @@ -101,8 +101,8 @@ function install_dask { # Install the main version of dask, distributed, and streamz gpuci_logger "Install the main version of dask, distributed, and streamz" set -x - pip install "git+https://github.com/dask/distributed.git@main" --upgrade --no-deps - pip install "git+https://github.com/dask/dask.git@main" --upgrade --no-deps + pip install "git+https://github.com/dask/distributed.git@2021.06.0" --upgrade --no-deps + pip install "git+https://github.com/dask/dask.git@2021.06.0" --upgrade --no-deps pip install "git+https://github.com/python-streamz/streamz.git" --upgrade --no-deps set +x } diff --git a/conda/environments/cudf_dev_cuda11.0.yml b/conda/environments/cudf_dev_cuda11.0.yml index 44396715e02..21ced3a0022 100644 --- a/conda/environments/cudf_dev_cuda11.0.yml +++ b/conda/environments/cudf_dev_cuda11.0.yml @@ -60,7 +60,7 @@ dependencies: - cachetools - transformers - pip: - - git+https://github.com/dask/dask.git@main - - git+https://github.com/dask/distributed.git@main + - git+https://github.com/dask/dask.git@2021.06.0 + - git+https://github.com/dask/distributed.git@2021.06.0 - git+https://github.com/python-streamz/streamz.git - pyorc diff --git a/conda/environments/cudf_dev_cuda11.2.yml b/conda/environments/cudf_dev_cuda11.2.yml index 8d88fb3d583..156a028ffdb 100644 --- a/conda/environments/cudf_dev_cuda11.2.yml +++ b/conda/environments/cudf_dev_cuda11.2.yml @@ -60,7 +60,7 @@ dependencies: - cachetools - transformers - pip: - - git+https://github.com/dask/dask.git@main - - git+https://github.com/dask/distributed.git@main + - git+https://github.com/dask/dask.git@2021.06.0 + - git+https://github.com/dask/distributed.git@2021.06.0 - git+https://github.com/python-streamz/streamz.git - pyorc diff --git a/conda/recipes/dask-cudf/run_test.sh b/conda/recipes/dask-cudf/run_test.sh index 3fc1182b33b..34d3fd632b7 100644 --- a/conda/recipes/dask-cudf/run_test.sh +++ b/conda/recipes/dask-cudf/run_test.sh @@ -9,11 +9,11 @@ function logger() { } # Install the latest version of dask and distributed -logger "pip install git+https://github.com/dask/distributed.git@main --upgrade --no-deps" -pip install "git+https://github.com/dask/distributed.git@main" --upgrade --no-deps +logger "pip install git+https://github.com/dask/distributed.git@2021.06.0 --upgrade --no-deps" +pip install "git+https://github.com/dask/distributed.git@2021.06.0" --upgrade --no-deps -logger "pip install git+https://github.com/dask/dask.git@main --upgrade --no-deps" -pip install "git+https://github.com/dask/dask.git@main" --upgrade --no-deps +logger "pip install git+https://github.com/dask/dask.git@2021.06.0 --upgrade --no-deps" +pip install "git+https://github.com/dask/dask.git@2021.06.0" --upgrade --no-deps logger "python -c 'import dask_cudf'" python -c "import dask_cudf" diff --git a/python/dask_cudf/dask_cudf/core.py b/python/dask_cudf/dask_cudf/core.py index 8af6188e625..f334237d1e8 100644 --- a/python/dask_cudf/dask_cudf/core.py +++ b/python/dask_cudf/dask_cudf/core.py @@ -11,7 +11,6 @@ import dask from dask import dataframe as dd from dask.base import normalize_token, tokenize -from dask.compatibility import apply from dask.context import _globals from dask.core import flatten from dask.dataframe.core import ( @@ -24,7 +23,7 @@ from dask.dataframe.utils import raise_on_meta_error from dask.highlevelgraph import HighLevelGraph from dask.optimization import cull, fuse -from dask.utils import M, OperatorMethodMixin, derived_from, funcname +from dask.utils import M, OperatorMethodMixin, apply, derived_from, funcname import cudf from cudf import _lib as libcudf diff --git a/python/dask_cudf/dask_cudf/io/csv.py b/python/dask_cudf/dask_cudf/io/csv.py index f00e91b5ff6..4dc803b3259 100644 --- a/python/dask_cudf/dask_cudf/io/csv.py +++ b/python/dask_cudf/dask_cudf/io/csv.py @@ -8,9 +8,8 @@ from dask import dataframe as dd from dask.base import tokenize -from dask.compatibility import apply from dask.dataframe.io.csv import make_reader -from dask.utils import parse_bytes +from dask.utils import apply, parse_bytes import cudf