Skip to content
forked from pydata/xarray

Commit de010ea

Browse files
committed
Try using uuids
xref pydata#8902 xref pydata#1525
1 parent 0e34528 commit de010ea

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

xarray/core/dataset.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import itertools
77
import math
88
import sys
9+
import uuid
910
import warnings
1011
from collections import defaultdict
1112
from collections.abc import (
@@ -257,7 +258,6 @@ def _get_chunk(var: Variable, chunks, chunkmanager: ChunkManagerEntrypoint):
257258
chunk_shape = chunkmanager.normalize_chunks(
258259
chunk_shape, shape=shape, dtype=var.dtype, previous_chunks=preferred_chunk_shape
259260
)
260-
261261
# Warn where requested chunks break preferred chunks, provided that the variable
262262
# contains data.
263263
if var.size:
@@ -344,7 +344,8 @@ def _maybe_chunk(
344344
# by providing chunks as an input to tokenize.
345345
# subtle bugs result otherwise. see GH3350
346346
# we use str() for speed, and use the name for the final array name on the next line
347-
token2 = tokenize(token if token else var._data, str(chunks))
347+
mixin = uuid.uuid4()
348+
token2 = tokenize(token if token else var._data, mixin)
348349
name2 = f"{name_prefix}{name}-{token2}"
349350

350351
from_array_kwargs = utils.consolidate_dask_from_array_kwargs(

0 commit comments

Comments
 (0)