You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/04/22 04:49:00 UTC

[jira] [Commented] (AIRFLOW-4568) The ExternalTaskSensor should be configurable to raise an Airflow Exception in case the poked external task reaches a disallowed state, such as f.i. failed

    [ https://issues.apache.org/jira/browse/AIRFLOW-4568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17089278#comment-17089278 ] 

ASF GitHub Bot commented on AIRFLOW-4568:
-----------------------------------------

lokeshlal opened a new pull request #8509:
URL: https://github.com/apache/airflow/pull/8509


   Added failed_states for ExternalTaskSensor to avoid waiting for the failure scenarios till timeout value
   
   - Added failed_states property in ExternalTaskSensor (defaulted to None)
   - Added corresponding checks against the failed_states and allowed states, such as duplicate values and valid values
   - Raise exception from poke method when the task or dag reaches the failed states
   
   ---
   Make sure to mark the boxes below before creating PR: [x]
   
   - [X] Description above provides context of the change
   - [X] Unit tests coverage for changes (not needed for documentation changes)
   - [X] Commits follow "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)"
   - [X] Relevant documentation is updated including usage instructions.
   - [X] I will engage committers as explained in [Contribution Workflow Example](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#contribution-workflow-example).
   
   ---
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
   Read the [Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines) for more information.
   


----------------------------------------------------------------
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.

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


> The ExternalTaskSensor should be configurable to raise an Airflow Exception in case the poked external task reaches a disallowed state, such as f.i. failed
> -----------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: AIRFLOW-4568
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-4568
>             Project: Apache Airflow
>          Issue Type: Improvement
>          Components: operators
>    Affects Versions: 1.10.3
>            Reporter: ddluke
>            Priority: Minor
>
> _As an engineer, I would like to have the behavior of the ExternalTaskSensor changed_
> _So that it fails in case the poked external_task_id fails_
> *Therefore*
>  * I suggest extending the behavior of the sensor to optionally also query the TaskInstance for disallowed states and raise an AirflowException if found. Currently, if the poked external task reaches a failed state, the sensor continues to poke and does not terminate
> *Acceptance Criteria (from my pov)*
>  * The class interface for ExternalTaskSensor is extended with an additional parameter, disallowed_states, which is an Optional List of airflow.utils.state.State
>  * The poke method is expanded to count the number of rows from TaskInstance which met the filter criteria dag_id, task_id, disallowed_states and dttm_filter if disallowed_states is not None
>  * If disallowed_states is not None and the above query returns a counter > 0, an Airflow Exception is thrown



--
This message was sent by Atlassian Jira
(v8.3.4#803005)