You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Limess (via GitHub)" <gi...@apache.org> on 2025/03/03 10:43:53 UTC

[I] ExternalTaskSensor does not support skipped_statesor failed_states when deferred [airflow]

Limess opened a new issue, #47298:
URL: https://github.com/apache/airflow/issues/47298

   ### Apache Airflow version
   
   2.10.5
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   [ExternalTaskSensor](https://airflow.apache.org/docs/apache-airflow/stable/howto/operator/external_task_sensor.html#externaltasksensor) supports `failed_states` and `skipped_states`.
   
   When deferred, it creates a `WorkflowTrigger` https://github.com/apache/airflow/blob/2.10.5/airflow/sensors/external_task.py#L350-L362, however it only passes through `allowed_states`, not `failed_states` or `skipped_states`. That results in these settings being ignored, and the sensor only completing on success.
   
   As a workaround, we can set deferrable=False for these sensors.
   
   ### What you think should happen instead?
   
   The sensor behaviour should not change based on defferable/non-deferrable - it should respect `failed_states` and `skipped_states`.
   
   ### How to reproduce
   
   Create a sensor, use `failed_states` or `skipped_states` to monitor an external task or task group which immediately skips. 
   
   If the sensor is non-deferrable, it will complete.
   If the sensor is deferrable, it will hang indefinitely until timeout.
   
   ### Operating System
   
   N/A
   
   ### Versions of Apache Airflow Providers
   
   N/A
   
   ### Deployment
   
   Other Docker-based deployment
   
   ### 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
   
   - [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] ExternalTaskSensor does not support skipped_statesor failed_states when deferred [airflow]

Posted by "Limess (via GitHub)" <gi...@apache.org>.
Limess closed issue #47298: ExternalTaskSensor does not support skipped_statesor failed_states when deferred
URL: https://github.com/apache/airflow/issues/47298


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] ExternalTaskSensor does not support skipped_statesor failed_states when deferred [airflow]

Posted by "Limess (via GitHub)" <gi...@apache.org>.
Limess commented on issue #47298:
URL: https://github.com/apache/airflow/issues/47298#issuecomment-2693986091

   Sorry, seems this is a dupe of https://github.com/apache/airflow/issues/41140 (I was originally targetting `skipped_states` so missed it in search!)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org