Skip to content

futures_of returns empty list for dict values input #3909

@bnaul

Description

@bnaul

Definitely debatable whether this is a bug or not but to me it seems undesirable:

[ins] In [2]: c = distributed.Client()

[nav] In [3]: f = c.submit(sum, [1, 2])

[ins] In [4]: distributed.futures_of([f])
Out[4]: [<Future: finished, type: builtins.int, key: sum-503d2c5687479ce1a33513b097c1af5c>]

[ins] In [5]: distributed.futures_of({"f": f})
Out[5]: [<Future: finished, type: builtins.int, key: sum-503d2c5687479ce1a33513b097c1af5c>]

[ins] In [6]: distributed.futures_of({"f": f}.values())
Out[6]: []

I was going to just make a PR but I'm actually not sure what the best way to test that something is a dict view......? If there's not a super clean way of doing it then maybe it's not worth the complexity. But in that case it would be nice if we could raise an exception here instead of incorrectly returning [].

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions