LionelZhao28 commented on a change in pull request #17749:
URL: https://github.com/apache/airflow/pull/17749#discussion_r693320362
##########
File path: airflow/example_dags/example_xcom.py
##########
@@ -81,3 +90,28 @@ def puller(**kwargs):
)
pull << [push1, push2]
+
+ bash_push = BashOperator(
+ task_id='bash_push',
+ bash_command='echo "bash_push demo" && '
+ 'echo "Manually set xcom value '
+ '{{ti.xcom_push(key="manually_pushed_value",
value="manually_pushed_value") }}" && '
+ 'echo "value_by_return"',
+ )
+ bash_pull = BashOperator(
+ task_id='bash_pull',
+ bash_command='echo "bash pull demo" && '
+ 'echo "The xcom pushed manually is '
+ '"{{ ti.xcom_pull(task_ids="bash_push",key="manually_pushed_value")
}}" && '
+ 'echo "The returned_value xcom is '
+ '"{{ ti.xcom_pull(task_ids="bash_push",key="return_value") }}" && '
+ 'echo "finished"',
+ do_xcom_push=False,
+ )
Review comment:
Submitted your suggestion.
Thanks.
BTW, does the pre-commit can check the format erro? Because I didn't see the
error in the pre-commit log. It showed success.
--
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]