Skip to content

Commit

Permalink
Use new tokenize module (#8858)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbourbeau authored Sep 4, 2024
1 parent 7c2134e commit 50169e9
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 10 deletions.
3 changes: 2 additions & 1 deletion distributed/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@
from tlz import first, groupby, merge, partition_all, valmap

import dask
from dask.base import collections_to_dsk, tokenize
from dask.base import collections_to_dsk
from dask.core import flatten, validate_key
from dask.highlevelgraph import HighLevelGraph
from dask.layers import Layer
from dask.optimization import SubgraphCallable
from dask.tokenize import tokenize
from dask.typing import Key, NoDefault, no_default
from dask.utils import (
apply,
Expand Down
2 changes: 1 addition & 1 deletion distributed/diagnostics/progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from tlz import groupby, valmap

from dask.base import tokenize
from dask.tokenize import tokenize
from dask.utils import key_split

from distributed.diagnostics.plugin import SchedulerPlugin
Expand Down
4 changes: 2 additions & 2 deletions distributed/protocol/serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import msgpack

import dask
from dask.base import normalize_token
from dask.sizeof import sizeof
from dask.tokenize import normalize_token
from dask.utils import typename

from distributed.metrics import context_meter
Expand Down Expand Up @@ -776,7 +776,7 @@ def register_serialization_lazy(toplevel, func):

@partial(normalize_token.register, Serialized)
def normalize_Serialized(o):
return [o.header] + o.frames # for dask.base.tokenize
return [o.header] + o.frames # for dask.tokenize.tokenize


# Teach serialize how to handle bytes
Expand Down
2 changes: 1 addition & 1 deletion distributed/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@

import dask
import dask.utils
from dask.base import TokenizationError, normalize_token, tokenize
from dask.core import get_deps, iskey, validate_key
from dask.tokenize import TokenizationError, normalize_token, tokenize
from dask.typing import Key, no_default
from dask.utils import (
_deprecated,
Expand Down
3 changes: 2 additions & 1 deletion distributed/shuffle/_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
from typing import TYPE_CHECKING, Any

import dask
from dask.base import is_dask_collection, tokenize
from dask.base import is_dask_collection
from dask.highlevelgraph import HighLevelGraph
from dask.layers import Layer
from dask.tokenize import tokenize

from distributed.shuffle._arrow import check_minimal_arrow_version
from distributed.shuffle._core import ShuffleId, barrier_key, get_worker_plugin
Expand Down
2 changes: 1 addition & 1 deletion distributed/shuffle/_rechunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@

import dask
import dask.config
from dask.base import tokenize
from dask.highlevelgraph import HighLevelGraph
from dask.layers import Layer
from dask.tokenize import tokenize
from dask.typing import Key
from dask.utils import parse_bytes

Expand Down
2 changes: 1 addition & 1 deletion distributed/shuffle/_shuffle.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
from tornado.ioloop import IOLoop

import dask
from dask.base import tokenize
from dask.highlevelgraph import HighLevelGraph
from dask.layers import Layer
from dask.tokenize import tokenize
from dask.typing import Key

from distributed.core import PooledRPCCall
Expand Down
4 changes: 2 additions & 2 deletions distributed/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import dask.bag as db
from dask import delayed
from dask.optimization import SubgraphCallable
from dask.tokenize import tokenize
from dask.utils import get_default_shuffle_method, parse_timedelta, tmpfile

from distributed import (
Expand Down Expand Up @@ -73,7 +74,6 @@
futures_of,
get_task_metadata,
temp_default_client,
tokenize,
wait,
)
from distributed.cluster_dump import load_cluster_dump
Expand Down Expand Up @@ -1127,7 +1127,7 @@ async def test_scatter_non_list(c, s, a, b):

@gen_cluster(client=True)
async def test_scatter_tokenize_local(c, s, a, b):
from dask.base import normalize_token
from dask.tokenize import normalize_token

class MyObj:
pass
Expand Down

0 comments on commit 50169e9

Please sign in to comment.