eladkal commented on a change in pull request #20071:
URL: https://github.com/apache/airflow/pull/20071#discussion_r764958126
##########
File path: tests/operators/test_python.py
##########
@@ -703,6 +703,25 @@ def test_clear_skipped_downstream_task(self):
else:
raise ValueError(f'Invalid task id {ti.task_id} found!')
+ def test_xcom_push(self):
+ dag = DAG(
+ 'shortcircuit_operator_test_xcom_push',
+ default_args={'owner': 'airflow', 'start_date': DEFAULT_DATE},
+ schedule_interval=INTERVAL,
+ )
+ short_op = ShortCircuitOperator(task_id='make_choice', dag=dag,
python_callable=lambda: 'signature')
Review comment:
~~I think this is not doing what you expect.
In `ShortCircuitOperator` the python_callable returns only True/False values.
If the value is False then the operator is looking for the downstream tasks
and change their status to Skip.
It's not the same as `BranchPythonOperator` where the python callable is
expected to return `task_ids`.~~
~~This is also why I'm having trouble understanding the feature request in
the issue as the request is to return the value of the condition which can be
True/False.
If it's False then no downstream task can ever use the value as it short
circuit all of them.
If it's True then what is there to do with the xcom?~~
Got what you mean now.
--
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]