Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core feature] Support warnings in task outputs #5356

Open
2 tasks done
EngHabu opened this issue May 12, 2024 · 2 comments
Open
2 tasks done

[Core feature] Support warnings in task outputs #5356

EngHabu opened this issue May 12, 2024 · 2 comments
Labels
enhancement New feature or request untriaged This issues has not yet been looked at by the Maintainers

Comments

@EngHabu
Copy link
Contributor

EngHabu commented May 12, 2024

Motivation: Why do you think this is important?

Sometimes "problems" happen during a task execution that don't warrant a failure but are good to be reported to the user so they can address them.
An example of this is if you forget to install flytekitplugins-dec-standard, the task will fail to write out Decks and because that's not a core functionality, it fails silently with just a log line while letting the task succeed.

Goal: What should the final outcome look like, ideally?

A task can produce warnings as part of its output (either generated by the system or the user) and these should be collected, visualized in the UI and bubbled up to the user.

Describe alternatives you've considered

Return an additional explicit output.

Propose: Link/Inline OR Additional context

No response

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

  • Yes

Have you read the Code of Conduct?

  • Yes
@EngHabu EngHabu added enhancement New feature or request untriaged This issues has not yet been looked at by the Maintainers labels May 12, 2024
Copy link

runllm bot commented May 12, 2024

To implement warnings in task outputs in Flyte, consider using a custom output type that includes a warnings field. This approach allows tasks to return both their primary outputs and any warnings. Modify the task's signature to include a warnings list and ensure these are displayed in the Flyte console. Here’s an example using Python:

from typing import List, Tuple
from flytekit import task, workflow

@task
def example_task() -> Tuple[str, List[str]]:
    warnings = []
    # Example condition that triggers a warning
    if True:
        warnings.append("This is a warning message.")
    return "Task completed successfully.", warnings

@workflow
def example_workflow() -> Tuple[str, List[str]]:
    result, warnings = example_task()
    return result, warnings

This code defines a task that returns a tuple of a result and a list of warnings. The workflow captures and returns both. Adjust the UI to display these warnings appropriately.

Would you like more details on integrating this with the Flyte UI or any other aspect?

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!

@eapolinario
Copy link
Contributor

eapolinario commented May 16, 2024

This is related to an old discussion: #3838.

We also talked about this and the naive solution to add another file (e.g. warnings.pb) to describe these special warnings can lead to a performance hit, so it's undesirable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request untriaged This issues has not yet been looked at by the Maintainers
Projects
None yet
Development

No branches or pull requests

2 participants