You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/12/20 18:26:31 UTC
[GitHub] [airflow] morooshka opened a new issue, #28500: Wrong skipping operator with NONE_FAILED_MIN_ONE_SUCCESS trigger rule after ShortCircuitOperator
morooshka opened a new issue, #28500:
URL: https://github.com/apache/airflow/issues/28500
### Apache Airflow version
2.5.0
### What happened
Operator with NONE_FAILED_MIN_ONE_SUCCESS trigger rule being wrongly skipped after the first parent operator had been skipped with its parent ShortCircuitOperator but some other parent operators are still being working. The same is reproducing with ONE_SUCCESS trigger rule
### What you think should happen instead
The operator with NONE_FAILED_MIN_ONE_SUCCESS (ONE_SUCCESS) trigger rule should wait for all parents (one success parent) operators
### How to reproduce
Please find the DAG example:
```
from datetime import datetime
from time import sleep
from airflow import DAG
from airflow.utils.trigger_rule import TriggerRule
from airflow.operators.dummy import DummyOperator
from airflow.operators.python import PythonOperator
from airflow.operators.python import ShortCircuitOperator
def do_sleep() -> bool:
sleep(1)
return True
with DAG(
dag_id="wrong_skip",
description='Wrong skip',
schedule_interval=None,
start_date=datetime(2022, 11, 29),
default_args={},
max_active_runs=1,
catchup=False,
params={},
is_paused_upon_creation=True,
tags=['sandbox']
) as dag:
task_switcher = ShortCircuitOperator(task_id="switcher", python_callable=lambda: False)
task_skipped = PythonOperator(task_id="skipped", python_callable=lambda: True)
task_executed = PythonOperator(task_id="executed", python_callable=do_sleep)
task_end = DummyOperator(task_id='problem', trigger_rule=TriggerRule.NONE_FAILED_MIN_ONE_SUCCESS)
task_switcher >> task_skipped >> task_end
task_executed >> task_end
```
The result of execution:
![image](https://user-images.githubusercontent.com/72786791/208738725-8c8f1b58-7020-4938-a272-c53a33d5efb4.png)
### Operating System
CentOS Linux 7 (Core)
### Versions of Apache Airflow Providers
_No response_
### Deployment
Virtualenv installation
### Deployment details
_No response_
### Anything else
The problem reproduces every time
### Are you willing to submit PR?
- [X] 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
[GitHub] [airflow] eladkal commented on issue #28500: Wrong skipping operator with NONE_FAILED_MIN_ONE_SUCCESS trigger rule after ShortCircuitOperator
Posted by GitBox <gi...@apache.org>.
eladkal commented on issue #28500:
URL: https://github.com/apache/airflow/issues/28500#issuecomment-1359968082
It's not a bug. It's by desgin.
Please read ShortCircuitOperator documntation.
You will find explnation and how to get the functionality you want :)
https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/operators/python/index.html#airflow.operators.python.ShortCircuitOperator
--
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
[GitHub] [airflow] eladkal closed issue #28500: Wrong skipping operator with NONE_FAILED_MIN_ONE_SUCCESS trigger rule after ShortCircuitOperator
Posted by GitBox <gi...@apache.org>.
eladkal closed issue #28500: Wrong skipping operator with NONE_FAILED_MIN_ONE_SUCCESS trigger rule after ShortCircuitOperator
URL: https://github.com/apache/airflow/issues/28500
--
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