I'm trying to run train a variety of models agains...
# ask-the-community
I'm trying to run train a variety of models against a single dataset. The general process works fine but I can't find a clean way to dynamically rename the tasks for each of the model types. Am I missing something? I tried
but it didn't seem to be picked up.
This should work
This will rename the node, cc @Jason Porter / @Soham Can you paste the screenshot of your the Ui
It might just be a Ui bug
yes. Let me triple check I didn't miss something if that was supposed to work.
training_file = data_aggregation(input_parquet_dir=output_file).with_overrides(name="agg_stuff")
Still might be missing something but that is what I'm seeing. Is there a different way I could check the names of the tasks?
Cc @Yee quick way to triage this
hey @Dan Corbiani - just want to clarify a couple things. the task name in normal workflows will not change… the name of the task is a parameter in the TaskTemplate and it’s stored in the database. however as ketan suggested you can override the node name. you can check out this unmerged example which we cooked up for internal testing.
tasks, it’s a little different. you can use the same syntax still. but to clarify what happens is that the actual details of the task that is run is not the version that’s stored in the database. (this is kinda a transparent detail for you, but just to clarify)
cuz you mentioned ‘dynamically rename the tasks’ but looking at the screenshot, it doesn’t look like you’re using the @dynamic task decorator right?
Finally got back to this. I think it's an error in the UI rendering. Here is the code I'm using:
Copy code
from typing import List

from flytekit import dynamic, task, workflow

def model_training(name: str) -> str:
    print(f"Hello {name}")
    return name

def hello_person(name: str) -> str:
    print(f"Hello {name}")
    return name

def people(names: List[str]) -> List[str]:
    ack = []
    for name in names:
    return ack

def hello_people(names: List[str]) -> List[str]:
    ack = people(names=names)
    other_names = ["bob", "sue"]
    for other_name in other_names:
    return ack

if __name__ == "__main__":
    output = hello_people(names=["bob", "sue"])
It seems to render correctly on the node page but not on the graph. It's also correct on the timeline view.
Cc @Jason Porter / @Soham
Ah okay, yeah its definitely not supposed to do that; we'll pick that up this sprint 👍 https://github.com/flyteorg/flyte/issues/3370
does anyone know if it’s possible to set the name of a
task using
? I tried
(didn’t work) and
(failed to run).
to clarify what I meant by “doesn’t work”, I mean that the name of the task node in the Flyte UI is still the function name instead of the name passed to
. And by “failed to run”, I mean that the task would exit with a failure message.