Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

`RuntimeError: Not enough arguments provided: missing keys` in `dask.persist` with mix of `Future` and `Delayed`

未关闭
#8,948 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
42/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python

调研方向

使用报告的版本变更运行最小示例,并将混合 Future/Delayed 情况与两个正常工作的情况进行比较。跟踪 dask.persist 在 dask/base.py、dask/core.py 和 dask/_task_spec.py 中的执行路径,尤其关注报告的 repack 和 missing-key 路径。完成的标准是混合输入不再引发 RuntimeError,同时现有的仅 Future 和仅 Delayed 情况继续正常工作。

由索引模型根据 Issue 内容生成。

描述

bug regression

Describe the issue:

I get a RuntimeError with some dask-ml code that worked with dask / distributed 2024.10.0 and earlier. With 2024.11.0 and newer, it fails:

Minimal Complete Verifiable Example:

import dask
import dask.distributed


@dask.delayed
def f(x):
    return x


def main():
    with dask.distributed.Client() as client:
        print(dask.persist(client.submit(lambda x: x, 1), f(0)))

if __name__ == "__main__":
    main()

On the older versions of dask, that prints out

(<Future: pending, key: lambda-80efb60e0b886931a35d757d5c4b3ac2>, Delayed('f-8a35b8af-26b5-427e-86c8-98b6d8b3f49f'))

Newer versions fail with

Traceback (most recent call last):
  File "/Users/tom/gh/dask/dask-ml/bug.py", line 15, in <module>
    main()
  File "/Users/tom/gh/dask/dask-ml/bug.py", line 12, in main
    print(dask.persist(client.submit(lambda x: x, 1), f(0)))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tom/gh/dask/dask-ml/.direnv/python-3.11/lib/python3.11/site-packages/dask/base.py", line 988, in persist
    return repack(results)
           ^^^^^^^^^^^^^^^
  File "/Users/tom/gh/dask/dask-ml/.direnv/python-3.11/lib/python3.11/site-packages/dask/base.py", line 535, in repack
    return simple_get(dsk, out)
           ^^^^^^^^^^^^^^^^^^^^
  File "/Users/tom/gh/dask/dask-ml/.direnv/python-3.11/lib/python3.11/site-packages/dask/core.py", line 102, in get
    result = execute_graph(dsk2, cache, keys=set(flatten([out])))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tom/gh/dask/dask-ml/.direnv/python-3.11/lib/python3.11/site-packages/dask/_task_spec.py", line 786, in execute_graph
    cache[key] = node(cache)
                 ^^^^^^^^^^^
  File "/Users/tom/gh/dask/dask-ml/.direnv/python-3.11/lib/python3.11/site-packages/dask/_task_spec.py", line 670, in __call__
    self._verify_values(values)
  File "/Users/tom/gh/dask/dask-ml/.direnv/python-3.11/lib/python3.11/site-packages/dask/_task_spec.py", line 428, in _verify_values
    raise RuntimeError(f"Not enough arguments provided: missing keys {missing}")
RuntimeError: Not enough arguments provided: missing keys {'lambda-80efb60e0b886931a35d757d5c4b3ac2'}

Anything else we need to know?:

It seems to be the combination of Futures and Delayed objects that causes issues. Both of these seem to work fine.

       print(dask.persist(client.submit(lambda x: x, 1), client.submit(lambda x: x, 2))  # OK
       print(dask.persist(f(0), f(1)))  # OK

I'll look for fixes / workarounds once I get up to speed on what's going on.

Environment:

  • Dask version:
  • Python version:
  • Operating System:
  • Install method (conda, pip, source):
主要语言
Python
星标
1.7k
派生
778
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

dask/distributed 的其他 Issue

查看 dask/distributed 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。