Skip to content

compute node names within delayed functions #1117

@maxhutch

Description

@maxhutch

I love using dask.imperative.delayed as a decorator to hide the daskyness from the driver code, but the names generated for dask.dot.dot_graph leave something to be desired. Its often easy to compute unique names within the delayed function, e.g.:

@delayed
def run(config):
    __task_name = "run_" + config["job_name"]
    res = do_stuff(config)
    return res

which can be done with a wrapper:

def run(config):
    task_name = "run_" + config["job_name"]
    return delayed(_run, name=task_name)(config)

def _run(config)
    res = do_stuff(config)
    return res

Any way to get rid of the wrapper step?

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