You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "hussein-awala (via GitHub)" <gi...@apache.org> on 2023/05/25 09:58:12 UTC
[GitHub] [airflow] hussein-awala commented on issue #31526: Short circuit task in expanded task group fails when it returns false
hussein-awala commented on issue #31526:
URL: https://github.com/apache/airflow/issues/31526#issuecomment-1562624325
@luederm Thank you for reporting this issue. For the future issues, it would be greatly appreciated if you could provide a reproducible example similar to the original one. This would help us identify whether the problem is due to misconfiguration/misuse of the operator or a bug.
For this one, I can reproduce it with:
```python
import pendulum
from airflow.decorators import dag, task, task_group, short_circuit_task
from airflow.operators.python import ShortCircuitOperator
@dag(
dag_id="test_short_circuit",
start_date=pendulum.datetime(2023, 1, 1),
schedule_interval=None,
)
def dag():
@task
def t1():
return [1, 2, 3, 4]
@task_group(group_id="task_group")
def group(x):
s = ShortCircuitOperator(
task_id="short_circuit",
python_callable=lambda arg: arg % 2 == 0,
op_kwargs={"arg": x},
)
@task
def t2(arg):
return arg
s >> t2(x)
group.expand(x=t1())
dag()
```
--
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