Skip to content

Client.get doesn't evaluate dependency if it's in dictionary value or nested inside dictionary #9186

Description

@dsevernyuk

Describe the issue:

When node is referenced in DAG not in top level list or tuple it's not evaluated when computing graph.

Minimal Complete Verifiable Example:

from dask.core import get_deps
from dask.distributed import Client
import operator

dag = { 
    "a": 3,
    "b": 4,
    "c": (operator.add,"a","b"),
    "d": {"arg1": "c"},
    "e": ["a", "c"],
    "f": { "inner_list": ["a", "c"] },
}
dask_client = Client()
print("Compute graph:")
print(dask_client.get(dag, ["d", "e", "f"]))
print("Dependencies:")
print(get_deps(dag)[0])

Anything else we need to know?:

Output when running the code above:

Compute graph:
[{'arg1': 'c'}, [3, 7], {'inner_list': ['a', 'c']}]
Dependencies:
{'a': set(), 'b': set(), 'c': {'a', 'b'}, 'd': {'c'}, 'e': {'a', 'c'}, 'f': {'a', 'c'}}

It's expected that dictionary values are also evaluated, like it's done for dependencies in top level list or tuple when calling get method. All those dependencies are detected by get_deps function, as above.

This can be related to the issue #8959 : this code example has been tested in dask 2024.11.2 and it produced the expected output, all nodes including inner ones were evaluated:

Compute graph:
[{'arg1': 7}, [3, 7], {'inner_list': [3, 7]}]
Dependencies:
{'a': set(), 'b': set(), 'c': {'b', 'a'}, 'd': {'c'}, 'e': {'a', 'c'}, 'f': {'a', 'c'}}

Environment:

  • Dask version: 2026.1.1
  • Python version: 3.13
  • Operating System: Debian 13 (trixie)
  • Install method (conda, pip, source): pip

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions