Giter VIP home page Giter VIP logo

Comments (2)

runllm avatar runllm commented on June 15, 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!

from flyte.

eapolinario avatar eapolinario commented on June 15, 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.

from flyte.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.