You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into a scenario where if I use an ExternalTaskSensor and set it to soft_fail=True but also set it to failed_states=['skipped'] I would expect if the external task skipped then to mark this sensor as skipped, however for the failed_states check in the poke method if it is in one of those states it will explicitly fail with an AirflowException.
Wouldn't it make more sense to skip because of the soft_fail?
Set that sensor to have external_dag_id be the other DAG and external_task_id be the skipped task in that other DAG and failed_states=['skipped'] and soft_fail=True
The ExternalTaskSensor fails instead of skips
Anything else
I don't know what is desirable for most Airflow users:
To have soft_fail to only cause skips if the sensor times out? (like it seems to currently do)
To have ExternalTaskSensor with soft_fail to skip any time it would otherwise fail, such as the external task being in one of the failed_states?
To have some other way for the ExternalTaskSensor to skip if the external task skipped?
Actually, I guess I'll add to this that if ExternalTaskSensor has soft_fail=True it should maybe skip if the external task is in any of the listed failed_states?
alexbegg
changed the title
ExternalTaskSensor should skip if soft_fail=True and failed_states=skipped
ExternalTaskSensor should skip if soft_fail=True and external task in one of the failed_states
Nov 22, 2021
…ailed_state (#23647)
* Respecting soft_fail in ExternalTaskSensor when the upstream tasks are in the failed state (#19754)
- Changed behaviour of sensor to as above to respect soft_fail
- Added tests of new soft_fail behaviour (#19754)
- Added newsfragment and improved sensor docstring
…ailed_state (#23647)
* Respecting soft_fail in ExternalTaskSensor when the upstream tasks are in the failed state (#19754)
- Changed behaviour of sensor to as above to respect soft_fail
- Added tests of new soft_fail behaviour (#19754)
- Added newsfragment and improved sensor docstring
(cherry picked from commit 1b34598)
…ailed_state (#23647)
* Respecting soft_fail in ExternalTaskSensor when the upstream tasks are in the failed state (#19754)
- Changed behaviour of sensor to as above to respect soft_fail
- Added tests of new soft_fail behaviour (#19754)
- Added newsfragment and improved sensor docstring
(cherry picked from commit 1b34598)
Apache Airflow version
2.1.4
Operating System
Debian GNU/Linux 10 (buster)
Versions of Apache Airflow Providers
No response
Deployment
Astronomer
Deployment details
No response
What happened
I ran into a scenario where if I use an
ExternalTaskSensor
and set it tosoft_fail=True
but also set it tofailed_states=['skipped']
I would expect if the external task skipped then to mark this sensor as skipped, however for thefailed_states
check in the poke method if it is in one of those states it will explicitly fail with anAirflowException
.Wouldn't it make more sense to skip because of the
soft_fail
?What you expected to happen
The
ExternalTaskSensor
task should skipHow to reproduce
BashOperator
task set to skip taken from https://airflow.apache.org/docs/apache-airflow/stable/howto/operator/bash.html#skipping:ExternalTaskSensor
external_dag_id
be the other DAG andexternal_task_id
be the skipped task in that other DAG andfailed_states=['skipped']
andsoft_fail=True
ExternalTaskSensor
fails instead of skipsAnything else
I don't know what is desirable for most Airflow users:
soft_fail
to only cause skips if the sensor times out? (like it seems to currently do)ExternalTaskSensor
withsoft_fail
to skip any time it would otherwise fail, such as the external task being in one of thefailed_states
?ExternalTaskSensor
to skip if the external task skipped?Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: