<#3533 [Core feature] Support no task execution in...
# flyte-github
a
#3533 [Core feature] Support no task execution in a conditional branch Issue created by yubofredwang Motivation: Why do you think this is important? As a Flyte user, I often have tasks that only need to run under certain conditions, and if conditions not satisfied, no task needs to be executed. Currently, the conditional in Flyte does not support skipping one of the branch without any task execution. This means that we will need to use a
noop
task to skip the branch. This will lead to waste of time during execution. For example:
Copy code
@task
def noop():
     ...

conditional("generate_artifact")
.if_(need_to_generate.is_true())
.then(generate_artifact())
.else_(noop())
This makes the code ugly and UI messy. We will need to figure out a way to cleanly handle this. Goal: What should the final outcome look like, ideally? Ideally, we can introduce something like`end()` or
skip()
operation in conditional to skip the branch, similar to
fail()
operation here: https://github.com/flyteorg/flytekit/blob/master/flytekit/core/condition.py#L295 Describe alternatives you've considered noop() task with cache is being used right now. it is bad coding practice and confusing in the UI. 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 flyteorg/flyte