ephraimbuddy commented on a change in pull request #16823:
URL: https://github.com/apache/airflow/pull/16823#discussion_r664836811
##########
File path: tests/models/test_taskinstance.py
##########
@@ -1163,6 +1163,33 @@ def test_xcom_push_flag(self):
ti.run()
assert ti.xcom_pull(task_ids=task_id, key=models.XCOM_RETURN_KEY) is
None
+ def test_xcom_push_with_a_specified_key_in_operator(self):
+ """
+ Tests the option for Operators to push XComs with a given key
+ """
+ key = 'mykey'
+ value = 'hello'
+ task_id = 'test_no_xcom_push'
+ dag = models.DAG(dag_id='test_xcom')
+
+ # XCom pushed with key=mykey
+ task = PythonOperator(
+ task_id=task_id,
+ dag=dag,
+ python_callable=lambda: value,
+ xcom_key=key,
Review comment:
I have provided answers to why we may need it in all operators. Check
https://github.com/apache/airflow/pull/16823#issuecomment-875037822
--
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]