A short circuit task returns a truthy or falsy value. If it is truthy, the run carries on; if it is falsy, everything downstream is skipped. Use it for "only continue if": the stores were open, a file had rows, today is a working day.
@task.short_circuit
def stores_open(ds=None):
closed = Variable.get("marigold_closed_days", default=[], deserialize_json=True)
return ds not in closed
By default it skips all downstream tasks, whatever their trigger rules. With @task.short_circuit(ignore_downstream_trigger_rules=False) it skips only its direct children and lets trigger rules decide further down, so a cleanup with all_done can still run.
A branch chooses between paths; a short circuit decides whether to go on at all. The classic form is ShortCircuitOperator.
On a closed day the function returns False and the rest of the run is skipped.