Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: relax dask version requirement and use a better check for Task #563

Merged
merged 10 commits into from
Dec 17, 2024
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down
7 changes: 3 additions & 4 deletions src/dask_awkward/layers/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@
from typing import TYPE_CHECKING, Any, Literal, Protocol, TypeVar, Union, cast

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
from typing_extensions import TypeAlias

from dask_awkward.utils import LazyInputsDict

_dask_uses_tasks = hasattr(dask.blockwise, "Task")

if _dask_uses_tasks:
from dask._task_spec import Task, TaskRef
from dask.blockwise import Task, TaskRef # type: ignore

if TYPE_CHECKING:
from awkward import Array as AwkwardArray
Expand Down
2 changes: 1 addition & 1 deletion src/dask_awkward/lib/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/dask_awkward/lib/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 # type: ignore

if TYPE_CHECKING:
from awkward._nplikes.typetracer import TypeTracerReport
Expand Down
Loading