flyteorg / flyte

Scalable and flexible workflow orchestration platform that seamlessly unifies data, ML and analytics stacks.
https://flyte.org
Apache License 2.0
5.41k stars 580 forks source link

[BUG] UI Issue when using approve in dynamic workflow when overriding node name #5642

Open shydefoo opened 1 month ago

shydefoo commented 1 month ago

Describe the bug

Summary

Expected behavior

Additional context to reproduce

Sample code to reproduce example:

from flytekit import task, workflow, dynamic
from flytekit import approve
from datetime import timedelta
from typing import List

@task
def review(v: int) -> str:
    return f"testing {v}"

@workflow
def subworkflow(v: int):
    t1 = review(v=v)
    approve(t1, "title-input", timeout=timedelta(hours=1))

@dynamic
def my_workflow_dynamic(int_list: List[int]):
    for i in int_list:
        subworkflow(v=i).with_overrides(node_name=f"subworkflow_{i}")

@workflow
def my_workflow(int_list: List[int]):
    my_workflow_dynamic(int_list=int_list)

if __name__ == "__main__":
    my_workflow()

Screenshots

No response

Are you sure this issue hasn't been raised already?

Have you read the Code of Conduct?

welcome[bot] commented 1 month ago

Thank you for opening your first issue here! 🛠

runllm[bot] commented 1 month ago

The issue you're encountering with the Flyte UI showing a TypeError when using approve in a dynamic workflow with overridden node names is likely related to known limitations and bugs in handling node name overrides, especially in dynamic contexts. According to this discussion and this GitHub issue, long node names or specific characters in node names can cause unexpected behavior in the Flyte UI.

To avoid this issue, you can either:

  1. Avoid using underscores in node names, as they are known to cause issues (source).
  2. Keep node names under 20 characters to prevent them from being hashed (source).

Would you like more details on how to handle node name overrides or any other aspect of Flyte?

Sources:


This is an AI-generated response and your feedback is appreciated! Please leave a 👍 if this is helpful and 👎 if it is not.

Mention @runllm to ask follow-up questions. See runllm.com for more!