From 30f70dd5709778c857a2983e37ba691c3044d70c Mon Sep 17 00:00:00 2001 From: Lindsey Gray Date: Tue, 17 Dec 2024 11:58:55 -0600 Subject: [PATCH 01/10] better check if dask is using Tasks --- src/dask_awkward/layers/layers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dask_awkward/layers/layers.py b/src/dask_awkward/layers/layers.py index b5c54523..b69405ad 100644 --- a/src/dask_awkward/layers/layers.py +++ b/src/dask_awkward/layers/layers.py @@ -6,8 +6,6 @@ import dask -_dask_uses_tasks = hasattr(dask, "_task_spec") - from dask.blockwise import Blockwise, BlockwiseDepDict, blockwise_token from dask.highlevelgraph import MaterializedLayer from dask.layers import DataFrameTreeReduction @@ -15,6 +13,8 @@ from dask_awkward.utils import LazyInputsDict +_dask_uses_tasks = hasattr(dask, "_task_spec") and hasattr(dask.blockwise, "Task") + if _dask_uses_tasks: from dask._task_spec import Task, TaskRef From cf39b3885aac75ea642a57aaa9a58bfe3b143123 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 18:01:51 +0000 Subject: [PATCH 02/10] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/dask_awkward/layers/layers.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/dask_awkward/layers/layers.py b/src/dask_awkward/layers/layers.py index b69405ad..305409a2 100644 --- a/src/dask_awkward/layers/layers.py +++ b/src/dask_awkward/layers/layers.py @@ -5,7 +5,6 @@ from typing import TYPE_CHECKING, Any, Literal, Protocol, TypeVar, Union, cast import dask - from dask.blockwise import Blockwise, BlockwiseDepDict, blockwise_token from dask.highlevelgraph import MaterializedLayer from dask.layers import DataFrameTreeReduction From 731ce1d6e7519cccd5e1a4c035321022a8b645c5 Mon Sep 17 00:00:00 2001 From: Lindsey Gray Date: Tue, 17 Dec 2024 12:03:34 -0600 Subject: [PATCH 03/10] revert pins --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2e4adb1d..d5514159 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,8 +37,7 @@ classifiers = [ ] dependencies = [ "awkward >=2.5.1", - "dask >=2024.12.0;python_version>'3.9'", - "dask >=2023.04.0;python_version<'3.10'", + "dask >=2023.04.0", "cachetools", "typing_extensions >=4.8.0", ] From 64b2a66d84357c9c42830494a2cd53cee579f8e2 Mon Sep 17 00:00:00 2001 From: Lindsey Gray Date: Tue, 17 Dec 2024 12:45:46 -0600 Subject: [PATCH 04/10] only check blockwise for Task; grab Task, TaskRef from blockwise --- src/dask_awkward/layers/layers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dask_awkward/layers/layers.py b/src/dask_awkward/layers/layers.py index 305409a2..27e1f15d 100644 --- a/src/dask_awkward/layers/layers.py +++ b/src/dask_awkward/layers/layers.py @@ -12,10 +12,10 @@ from dask_awkward.utils import LazyInputsDict -_dask_uses_tasks = hasattr(dask, "_task_spec") and hasattr(dask.blockwise, "Task") +_dask_uses_tasks = hasattr(dask.blockwise, "Task") if _dask_uses_tasks: - from dask._task_spec import Task, TaskRef + from dask.blockwise import Task, TaskRef if TYPE_CHECKING: from awkward import Array as AwkwardArray From 49a6d62fe2135a1832398abdccb60bd4b96793ed Mon Sep 17 00:00:00 2001 From: Lindsey Gray Date: Tue, 17 Dec 2024 12:47:11 -0600 Subject: [PATCH 05/10] take _task_spec classes from blockwise --- src/dask_awkward/lib/optimize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dask_awkward/lib/optimize.py b/src/dask_awkward/lib/optimize.py index 4b9dd6cf..0eba92fa 100644 --- a/src/dask_awkward/lib/optimize.py +++ b/src/dask_awkward/lib/optimize.py @@ -22,7 +22,7 @@ from dask_awkward.utils import first if _dask_uses_tasks: - from dask._task_spec import GraphNode, Task, TaskRef + from dask.blockwise import GraphNode, Task, TaskRef if TYPE_CHECKING: from awkward._nplikes.typetracer import TypeTracerReport From dd1e5ddb6da0a9bbe091ef68a02db0b3a1c6e250 Mon Sep 17 00:00:00 2001 From: Lindsey Gray Date: Tue, 17 Dec 2024 12:50:50 -0600 Subject: [PATCH 06/10] grab TaskRef from blockwise --- src/dask_awkward/lib/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dask_awkward/lib/core.py b/src/dask_awkward/lib/core.py index a9567a56..be2746b7 100644 --- a/src/dask_awkward/lib/core.py +++ b/src/dask_awkward/lib/core.py @@ -62,7 +62,7 @@ ) if _dask_uses_tasks: - from dask._task_spec import TaskRef + from dask.blockwise import TaskRef # type: ignore if TYPE_CHECKING: from awkward.contents.content import Content From 407401d8dca60d6c7aa186fda462b71950d324e1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 18:51:09 +0000 Subject: [PATCH 07/10] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/dask_awkward/lib/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dask_awkward/lib/core.py b/src/dask_awkward/lib/core.py index be2746b7..6becf1b1 100644 --- a/src/dask_awkward/lib/core.py +++ b/src/dask_awkward/lib/core.py @@ -62,7 +62,7 @@ ) if _dask_uses_tasks: - from dask.blockwise import TaskRef # type: ignore + from dask.blockwise import TaskRef # type: ignore if TYPE_CHECKING: from awkward.contents.content import Content From 481d1d91d86e5d30934079e46a0fe0d1b28f2830 Mon Sep 17 00:00:00 2001 From: Lindsey Gray Date: Tue, 17 Dec 2024 12:51:18 -0600 Subject: [PATCH 08/10] appease mypy --- src/dask_awkward/layers/layers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dask_awkward/layers/layers.py b/src/dask_awkward/layers/layers.py index 27e1f15d..8d476cb2 100644 --- a/src/dask_awkward/layers/layers.py +++ b/src/dask_awkward/layers/layers.py @@ -15,7 +15,7 @@ _dask_uses_tasks = hasattr(dask.blockwise, "Task") if _dask_uses_tasks: - from dask.blockwise import Task, TaskRef + from dask.blockwise import Task, TaskRef # type: ignore if TYPE_CHECKING: from awkward import Array as AwkwardArray From 86054f0ac2d565539f7d65caac83f32f01e7862d Mon Sep 17 00:00:00 2001 From: Lindsey Gray Date: Tue, 17 Dec 2024 12:51:37 -0600 Subject: [PATCH 09/10] appease mypy --- src/dask_awkward/lib/optimize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dask_awkward/lib/optimize.py b/src/dask_awkward/lib/optimize.py index 0eba92fa..e67fed30 100644 --- a/src/dask_awkward/lib/optimize.py +++ b/src/dask_awkward/lib/optimize.py @@ -22,7 +22,7 @@ from dask_awkward.utils import first if _dask_uses_tasks: - from dask.blockwise import GraphNode, Task, TaskRef + from dask.blockwise import GraphNode, Task, TaskRef # type: ignore if TYPE_CHECKING: from awkward._nplikes.typetracer import TypeTracerReport From a88502fbea9a90389d38027324d12afe650e2c89 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 18:52:10 +0000 Subject: [PATCH 10/10] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/dask_awkward/layers/layers.py | 2 +- src/dask_awkward/lib/optimize.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dask_awkward/layers/layers.py b/src/dask_awkward/layers/layers.py index 8d476cb2..f994227a 100644 --- a/src/dask_awkward/layers/layers.py +++ b/src/dask_awkward/layers/layers.py @@ -15,7 +15,7 @@ _dask_uses_tasks = hasattr(dask.blockwise, "Task") if _dask_uses_tasks: - from dask.blockwise import Task, TaskRef # type: ignore + from dask.blockwise import Task, TaskRef # type: ignore if TYPE_CHECKING: from awkward import Array as AwkwardArray diff --git a/src/dask_awkward/lib/optimize.py b/src/dask_awkward/lib/optimize.py index e67fed30..6f5b4a4c 100644 --- a/src/dask_awkward/lib/optimize.py +++ b/src/dask_awkward/lib/optimize.py @@ -22,7 +22,7 @@ from dask_awkward.utils import first if _dask_uses_tasks: - from dask.blockwise import GraphNode, Task, TaskRef # type: ignore + from dask.blockwise import GraphNode, Task, TaskRef # type: ignore if TYPE_CHECKING: from awkward._nplikes.typetracer import TypeTracerReport