Coder Social home page Coder Social logo

New State type: TRIGGER_FAILED about prefect HOT 6 CLOSED

jlowin avatar jlowin commented on August 15, 2024
New State type: TRIGGER_FAILED

from prefect.

Comments (6)

jlowin avatar jlowin commented on August 15, 2024 1

I'm on board with TriggerFailed subclassing Failed -- one of the reasons I was hesitant about that at first was it would then trigger subsequent tasks as if the task had failed (for example, if the subsequent task had an all_failed trigger) but your skip analogy helps me see that that is probably a good thing

from prefect.

cicdw avatar cicdw commented on August 15, 2024

@jlowin Just so we're on the same page, do you agree that this test should pass and that this gets at the heart of the matter?

def test_flow_runner_with_trigger_task():
    flow = prefect.Flow()
    task1 = ErrorTask()
    task2 = SuccessTask()
    flow.add_edge(task1, task2)
    flow_state = FlowRunner(flow=flow).run(return_tasks=[task1, task2]) 
    assert isinstance(flow_state, Failed)                                        
    assert isinstance(flow_state.data[task1], Success)                           
    assert isinstance(flow_state.data[task2], Trigger_Failed)
    assert not isinstance(flow_state.data[task2], Failed)

from prefect.

jlowin avatar jlowin commented on August 15, 2024

Yes, I agree. Moreover, it also isn't a SUCCESS State, either.

from prefect.

cicdw avatar cicdw commented on August 15, 2024

Question: how should TriggerFailed terminal states affect the overall status of a Flow, and should it be a hard-and-fast rule or user-determined?

If we include TriggerFailed as a not-failed, not-successful Finished state, then our current flow-level state-logic renders the above Flow a Success which doesn't feel right.

I've played with having TriggerFailed take an optional is_failure parameter determining whether it should be treated as such, but these leads to all sorts of weird inconsistencies with TriggerFailed().is_failed() is True vs. isinstance(TriggerFailed(), Failed) is False.

from prefect.

cicdw avatar cicdw commented on August 15, 2024

I'm starting to suspect that TriggerFailed should just be a subclass of Failed (maybe it's the Failed analogue of Skipped), and whether that results in Flow failures or not can be adjusted via #26 (i.e., if it's a failure cleanup task, then the Flow would be looking to the inner task for its state, not the TriggerFailed task).

from prefect.

cicdw avatar cicdw commented on August 15, 2024

Closed with #59

from prefect.

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.