Skip to content
forked from pydata/xarray

Commit

Permalink
Try using uuids
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Dec 16, 2024
1 parent 0e34528 commit de010ea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import itertools
import math
import sys
import uuid
import warnings
from collections import defaultdict
from collections.abc import (
Expand Down Expand Up @@ -257,7 +258,6 @@ def _get_chunk(var: Variable, chunks, chunkmanager: ChunkManagerEntrypoint):
chunk_shape = chunkmanager.normalize_chunks(
chunk_shape, shape=shape, dtype=var.dtype, previous_chunks=preferred_chunk_shape
)

# Warn where requested chunks break preferred chunks, provided that the variable
# contains data.
if var.size:
Expand Down Expand Up @@ -344,7 +344,8 @@ def _maybe_chunk(
# by providing chunks as an input to tokenize.
# subtle bugs result otherwise. see GH3350
# we use str() for speed, and use the name for the final array name on the next line
token2 = tokenize(token if token else var._data, str(chunks))
mixin = uuid.uuid4()
token2 = tokenize(token if token else var._data, mixin)
name2 = f"{name_prefix}{name}-{token2}"

from_array_kwargs = utils.consolidate_dask_from_array_kwargs(
Expand Down

0 comments on commit de010ea

Please sign in to comment.