Thread
#prefect-community
    ale

    ale

    1 year ago
    Hey folks 🙂 Is there a way to enrich a task state with additional variables? I know this can be done when using signals, but I would like to add some custom variables to a task state even without using signals. The main reason for doing this is to consume the variables in state handlers
    Jim Crist-Harif

    Jim Crist-Harif

    1 year ago
    Since tasks don't directly return state objects unless they're using signals, this isn't currently possible from within a task definition itself.
    What custom info are you trying to pass? Why the reluctance to use signals?
    ale

    ale

    1 year ago
    I'm trying to attach dbt logs returned from DbtShellTask. I'd like to have them in the state object so I can use them in a state handler and send them to Slack
    Jim Crist-Harif

    Jim Crist-Harif

    1 year ago
    If you're returning all the stdout from the shell task, then wouldn't that info already be available in the state handler?
    ale

    ale

    1 year ago
    Didn't think about this, let me try 🙂