https://flyte.org logo
#ask-the-community
Title
# ask-the-community
g

Gauthier Castro

11/01/2023, 2:54 PM
Hey there, is there a way to rename a task so that it has the same implementation but a different name in a workflow? Something like rename perhaps?
Copy code
@task
def process_data(data: List[float]) -> list[Float]:
    ...

@workflow
def wf(data1: List[float], data2: List[float]) -> None:
    processed_data1 = process_data(data=data1).rename("process_data1")
    processed_data2 = process_data(data=data2).rename("process_data2")
    ...
k

Ketan (kumare3)

11/01/2023, 3:06 PM
Not the task but the node in the workflow absolutely
g

Gauthier Castro

11/01/2023, 3:07 PM
That’s what I mean. How do you rename a node in the workflow?
g

Gauthier Castro

11/01/2023, 3:10 PM
I did come across with_overrides but wasn’t sure where to look for specific attributes. Would that be
.with_overrides(name="my_name")
.
with_overrides(task_name="my_name")
?
k

Ketan (kumare3)

11/01/2023, 3:21 PM
Name=
Cc @Nikki Everett
g

Gauthier Castro

11/01/2023, 3:37 PM
It seems to work with
.with_overrides(name="my_name")
snake case
n

Nikki Everett

11/01/2023, 3:46 PM
looks like there's already an issue to update that section of the docs, so i can comment there. we should probably just go ahead and document all parameters of
with_overrides
in that section, even though the focus is technically on resource allocation
6 Views