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

   ### Apache Airflow version
   
   Other Airflow 2 version (please specify below)
   
   ### What happened
   
   AirFlow version 2.3.3.
   
   When we use TaskFlow API for the DAG and have some task with 
`trigger_rule="none_failed"` this task fails when its predecessor is skipped. 
The error occurs during XCom read:
   
   ```
   File "/usr/local/lib/python3.8/site-packages/airflow/models/xcom_arg.py", 
line 152, in resolve
       raise AirflowException(
   airflow.exceptions.AirflowException: XComArg result from exec at skip_test 
with key="return_value" is not found!
   ```
   
   ### What you think should happen instead
   
   It should execute its code with empty input. This behaviour existed in 
version 2.2.3. Also it's well aligned with behaviour of general tasks connected 
by arrows: downstream task executes successfully with empty input.
   
   ### How to reproduce
   
   1. Create a DAG.
   2. Add `@task`-decorated task that raises `AirflowSkipException`
   3. Add another `@task`-decorated task that checks if its input is empty.
   4. Pass an output of the first task to the second task.
   5. Add DummyOperator task as a downstream of the first task. 
`trigger_rule="none_failed"`
   6. Execute a DAG.
   7. The second task fails.
   
   ```py
   from airflow.decorators import dag, task
   from airflow.utils.dates import days_ago
   from airflow.exceptions import AirflowSkipException
   from airflow.operators.dummy import DummyOperator
   
   @dag(start_date=days_ago(1))
   def skip_test():
   
       @task
       def exec():
           raise AirflowSkipException("skipping")
   
       # This will fail
       @task(trigger_rule="none_failed")
       def finish(prev_res):
           print(prev_res is None)
   
       # While this will not
       finish_2 = DummyOperator(
           task_id = "finish_2",
           trigger_rule="none_failed"
       )
   
       exec_res = exec()
       finish(exec_res)
       exec_res >> finish_2
   
       return 
   
   G_DUMMY = skip_test()
   
   ```
   
   ### Operating System
   
   Debian GNU/Linux 10 (buster)
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### 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
   
   - [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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to