Repository navigation
Description
Apache Airflow version
3.0.6
If "Other Airflow 2 version" selected, which one?
No response
What happened?
The short circuit operator does not skip mapped tasks when trigger rule is set to none_failed and ignore_downstream_trigger_rules is set to True
What you think should happen instead?
I would expect that mapped task instances would be skipped if the short circuit task returns a False value, but instead they are executed
How to reproduce
from airflow.sdk import Asset, dag, task
a = Asset("test_tmp_dag")
b = Asset("test_tmp_dag2")
@dag(dag_id="test_tmp_dag", schedule=None, default_args={"trigger_rule": "none_failed"})
def test_tmp_dag():
multi = [1,2,3]
@task.short_circuit(task_id="dummy1", ignore_downstream_trigger_rules=True)
def dummy1():
if 2 == 2:
return False
else:
return "dummy1"
@task(task_id="dummy2")
def dummy2():
return "dummy2"
@task(task_id="dummy3")
def dummy3(x: int):
return f"dummy3-{x}"
@task(task_id="publish", outlets=[a,b])
def publish():
return "published"
d1 = dummy1()
d2 = dummy2()
d3 = dummy3.expand(x=multi)
p = publish()
# The result of the task function call is a Task object
d1 >> d2 >> d3 >> p
test_tmp_dag()
This dag demonstrates the problem - dummy2 and publish are correctly skipped, but the mapped tasks in dummy3 are executed.
Operating System
Ubuntu 24.04.2 LTS
Versions of Apache Airflow Providers
apache-airflow-providers-amazon==9.12.0
apache-airflow-providers-celery==3.12.2
apache-airflow-providers-common-compat==1.7.3
apache-airflow-providers-common-io==1.6.2
apache-airflow-providers-common-sql==1.27.5
apache-airflow-providers-http==5.3.3
apache-airflow-providers-postgres==6.2.3
apache-airflow-providers-smtp==2.2.0
apache-airflow-providers-standard==1.6.0
Deployment
Docker-Compose
Deployment details
No response
Anything else?
No response
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Activity
boring-cyborg commentedon Sep 3, 2025
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
suhail-zemoso commentedon Sep 4, 2025
I would like to work on this issue--Let me know if it's being picked by someone else.
suhail-zemoso commentedon Sep 5, 2025
@dv-matthew-crown
If you add trigger_rule="all_success" to the mapped task (dummy3 and published), we can achieve the expected behavior, which is that dummy2, dummy3, and published will be skipped.
dv-matthew-crown commentedon Sep 5, 2025
My mapped tasks require trigger rule none_failed when running normally, so this would not be a solution in my opinion
dv-matthew-crown commentedon Sep 5, 2025
@suhail-zemoso what is also interesting, is that despite the mapped tasks failing the overall DAG is marked as successful
vatsrahul1001 commentedon Oct 29, 2025
Not able to reproduce this with version 3.1.1. Closing the issue. Please feel free to reopen if you’re still facing it.
Chais commentedon Sep 30, 2026
Commenting because I see this misbehaviour in 3.3.0. In fact it looks like short circuiting doesn't work as soon as mapped tasks are involved.
Minimal example:
dv-matthew-crown commentedon Sep 30, 2026
yep, i have been seeing this consistently since i reported and your minimal example shows the same state - @vatsrahul1001 can we reopen ?
kaxil commentedon Sep 30, 2026
Reopening: both reports reproduce on main, and they are two separate bugs.
map_index=-1row of a mapped task. A task mapped over a literal list already has task instances0..n-1when the run is created, so none of them were skipped, andnone_failedlet them run. This has been the case since 3.0. Fix: Fix short-circuit not skipping already expanded mapped tasks #73960.NotPreviouslySkippedDepreads the skip decision atmap_index=-1unless the parent is a mapped operator. A task inside a mapped task group writes that decision per map index, so it was never found. Fix: Fix short-circuit inside a mapped task group not skipping downstream #73959.In the playground example,
group_2.printstrwill be skipped for every map index once anygroup_1.printstris skipped, not about half the time.group_2is a separate mapped task group, so each of its instances depends on allgroup_1.printstrinstances, and the defaultall_successrule skips it.