<#3865 [BUG] Dynamic task name override does not w...
# flyte-github
a
#3865 [BUG] Dynamic task name override does not work when multiple tasks are created Issue created by gpgn Describe the bug Task names can be overridden with
.with_overrides(node_name="foo")
. This is useful for dynamic tasks especially, because they get cryptic identifiers such as
d1-n-dn0
by default, making it difficult to see in the UI for what iteration a dynamically created task is running. If multiple sub-tasks are created, the name override works initially for all tasks, but then fails for any tasks after the initial one. Expected behavior Overridden task names are visible throughout in the UI. Additional context to reproduce
Copy code
from flytekit import Resources, WorkflowFailurePolicy, dynamic, task, workflow


@task(
    limits=Resources(mem="500Mi"),
)
def some_task(
    val: str,
):
    print(val)


@dynamic(limits=Resources(mem="500Mi"))
def base_workflow():
    # set up task promises
    for val in ["one", "two", "three"]:
        task_some_task = some_task(
            val=val,
        ).with_overrides(node_name=f"{val}-some-task")
        task_some_other_task = some_task(
            val=val,
        ).with_overrides(node_name=f"{val}-some-other-task")

        task_some_task >> task_some_other_task


@workflow(    failure_policy=WorkflowFailurePolicy.FAIL_AFTER_EXECUTABLE_NODES_COMPLETE,
)
def wf():
    base_workflow()
Screenshots

image

Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte