question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Skip task itself instead of all downstream tasks

See original GitHub issue

Apache Airflow version: 1.10.10

Kubernetes version (if you are using kubernetes) (use kubectl version):

Environment:

  • Cloud provider or hardware configuration: any
  • OS (e.g. from /etc/os-release): any
  • Kernel (e.g. uname -a): any
  • Install tools: any
  • Others: any

What happened:

  • When a sensor is set to soft_fail=True, it becomes skipped when it fails. However, it also calls BaseSensorOperator._do_skip_downstream_tasks() and skips all of its downstream tasks unconditionally, including those with trigger_rule none_failed, one_success etc.
  • ShortCircuitOperator is similar. When it is skipped, it skips all its downstream tasks unconditionally.

What you expected to happen:

  • When a soft_fail sensor fails, it should skip itself. Downstream tasks with trigger_rule all_success (i.e. the default) should be skipped because of TriggerRuleDep. Tasks that are none_failed or one_success etc should not be skipped unconditionally by the soft_fail sensor.
  • Same applies for ShortCircuitOperator

How to reproduce it: Any DAG with soft_fail or ShortCircuitOperator and downstream tasks having trigger_rule none_failed, one_success will have this problem.

Anything else we need to know:

An old issue addressed this in general and made it possible for operators to skip themselves and not its downstream. The same principle should be applied to soft_fail and ShortCircuitOperator: https://github.com/apache/airflow/pull/1292

The fix should to this issue is rather simple, just raise AirflowSkipException and not skip downstream tasks. Leave it to the TriggerRuleDep to do the skip based on the trigger_rule of tasks.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
j-y-matsubaracommented, Aug 6, 2020

Thank you for your reply, @ccage-simp I’m sorry, I made a wrong interpretation about your comment.

Best Regard,

0reactions
yuqian90commented, Aug 7, 2020

Great thank you so much @j-y-matsubara

Read more comments on GitHub >

github_iconTop Results From Across the Web

Airflow - Skip all downstream tasks in 1 shot - Stack Overflow
It evaluates a condition and short-circuits the workflow if the condition is False. Any downstream tasks are marked with a state of "skipped"....
Read more >
Tasks — Airflow Documentation
A Task is the basic unit of execution in Airflow. Tasks are arranged into DAGs, and then have upstream and downstream dependencies set...
Read more >
Airflow Trigger Rules for Building Complex Data Pipelines ...
To demonstrate None Skipped , I took reference from One Success sample - Ideally, all downstream should be skipped if one upstream task...
Read more >
Skip tasks to make your debugging easy - YouTube
Session presented by Howie Wang at Airflow Summit 2022In Apple, we are building a self-serve data platform based on Airflow.
Read more >
Top Features in the Airflow 2.3 Release - Six Feet Up
Dynamic task mapping lets Airflow trigger tasks based on ... New ALL_SKIPPED trigger rule Trigger Rule when all upstream tasks are in a ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found