-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
dask/distributed
#9169Labels
bugSomething is brokenSomething is brokenneeds attentionIt's been a while since this was pushed on. Needs attention from the owner or a maintainer.It's been a while since this was pushed on. Needs attention from the owner or a maintainer.p2Affects more than a few users but doesn't prevent core functionsAffects more than a few users but doesn't prevent core functions
Description
Describe the issue:
As of Python 3.12, pickling an itertools object has been deprecated, and in Python 3.14, it will no longer work. This causes a failure in test_multiple_repartition_partition_size:
___________________ test_multiple_repartition_partition_size ___________________
[gw2] linux -- Python 3.14.0 /usr/bin/python3
def test_multiple_repartition_partition_size():
b = db.from_sequence(range(1, 100), npartitions=1)
total_mem = sum(b.map_partitions(total_mem_usage).compute())
c = b.repartition(partition_size=(total_mem // 2))
assert c.npartitions >= 2
assert_eq(b, c)
> d = c.repartition(partition_size=(total_mem // 5))
dask/bag/tests/test_bag.py:1305:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
dask/bag/core.py:1694: in repartition
return repartition_size(self, partition_size)
dask/bag/core.py:2666: in repartition_size
mem_usages = bag.map_partitions(total_mem_usage).compute()
../BUILDROOT/usr/lib/python3.14/site-packages/dask/base.py:373: in compute
(result,) = compute(self, traverse=False, **kwargs)
../BUILDROOT/usr/lib/python3.14/site-packages/dask/base.py:681: in compute
results = schedule(expr, keys, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
exc = TypeError(TypeError("cannot pickle 'itertools.chain' object"), ' File "/builddir/build/BUILD/python-dask-2025.7.0-bui... ~~~~~~~~^^^^^^^^^^^\n File "/usr/lib64/python3.14/copy.py", line 146, in deepcopy\n rv = reductor(4)\n')
tb = ' File "/builddir/build/BUILD/python-dask-2025.7.0-build/BUILDROOT/usr/lib/python3.14/site-packages/dask/local.py", l... ~~~~~~~~^^^^^^^^^^^\n File "/usr/lib64/python3.14/copy.py", line 146, in deepcopy\n rv = reductor(4)\n'
def reraise(exc, tb=None):
exc = remote_exception(exc, tb)
> raise exc
E dask.multiprocessing.TypeError: cannot pickle 'itertools.chain' object
E
E Traceback
E ---------
E File "/builddir/build/BUILD/python-dask-2025.7.0-build/BUILDROOT/usr/lib/python3.14/site-packages/dask/local.py", line 258, in execute_task
E result = task(data)
E File "/builddir/build/BUILD/python-dask-2025.7.0-build/BUILDROOT/usr/lib/python3.14/site-packages/dask/_task_spec.py", line 759, in __call__
E return self.func(*new_argspec)
E ~~~~~~~~~^^^^^^^^^^^^^^
E File "/builddir/build/BUILD/python-dask-2025.7.0-build/BUILDROOT/usr/lib/python3.14/site-packages/dask/_task_spec.py", line 199, in _execute_subgraph
E res = execute_graph(final, keys=[outkey])
E File "/builddir/build/BUILD/python-dask-2025.7.0-build/BUILDROOT/usr/lib/python3.14/site-packages/dask/_task_spec.py", line 1078, in execute_graph
E cache[key] = node(cache)
E ~~~~^^^^^^^
E File "/builddir/build/BUILD/python-dask-2025.7.0-build/BUILDROOT/usr/lib/python3.14/site-packages/dask/_task_spec.py", line 759, in __call__
E return self.func(*new_argspec)
E ~~~~~~~~~^^^^^^^^^^^^^^
E File "/builddir/build/BUILD/python-dask-2025.7.0-build/BUILDROOT/usr/lib/python3.14/site-packages/dask/bag/core.py", line 2655, in total_mem_usage
E partition = reify(deepcopy(partition))
E ~~~~~~~~^^^^^^^^^^^
E File "/usr/lib64/python3.14/copy.py", line 146, in deepcopy
E rv = reductor(4)
../BUILDROOT/usr/lib/python3.14/site-packages/dask/multiprocessing.py:112: TypeErrorMinimal Complete Verifiable Example:
pytest
Environment:
- Dask version: 2025.7.0
- Python version: 3.14
- Operating System: Fedora Rawhide
- Install method (conda, pip, source): source
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething is brokenSomething is brokenneeds attentionIt's been a while since this was pushed on. Needs attention from the owner or a maintainer.It's been a while since this was pushed on. Needs attention from the owner or a maintainer.p2Affects more than a few users but doesn't prevent core functionsAffects more than a few users but doesn't prevent core functions