turbaszek commented on a change in pull request #12376:
URL: https://github.com/apache/airflow/pull/12376#discussion_r525980510
##########
File path: airflow/example_dags/example_xcom.py
##########
@@ -81,6 +78,10 @@ def puller(**kwargs):
task_id='puller',
dag=dag,
python_callable=puller,
+ op_args=[
+ push1.output['value_from_pusher 1'],
Review comment:
```suggestion
push1.output['value from pusher 1'],
```
Otherwise the DAG is failing:
```
*** Reading local file:
/root/airflow/logs/example_xcom/puller/2020-11-18T10:28:58.185921+00:00/1.log
[2020-11-18 10:29:04,239] {taskinstance.py:827} INFO - Dependencies all met
for <TaskInstance: example_xcom.puller 2020-11-18T10:28:58.185921+00:00
[queued]>
[2020-11-18 10:29:04,285] {taskinstance.py:827} INFO - Dependencies all met
for <TaskInstance: example_xcom.puller 2020-11-18T10:28:58.185921+00:00
[queued]>
[2020-11-18 10:29:04,287] {taskinstance.py:1018} INFO -
--------------------------------------------------------------------------------
[2020-11-18 10:29:04,289] {taskinstance.py:1019} INFO - Starting attempt 1
of 1
[2020-11-18 10:29:04,290] {taskinstance.py:1020} INFO -
--------------------------------------------------------------------------------
[2020-11-18 10:29:04,306] {taskinstance.py:1039} INFO - Executing
<Task(PythonOperator): puller> on 2020-11-18T10:28:58.185921+00:00
[2020-11-18 10:29:04,313] {standard_task_runner.py:50} INFO - Started
process 37596 to run task
[2020-11-18 10:29:04,327] {standard_task_runner.py:74} INFO - Running:
['airflow', 'tasks', 'run', 'example_xcom', 'puller',
'2020-11-18T10:28:58.185921+00:00', '--job-id', '8', '--pool', 'default_pool',
'--raw', '--subdir', '/opt/airflow/airflow/example_dags/example_xcom.py',
'--cfg-path', '/tmp/tmpdql6__s7']
[2020-11-18 10:29:04,331] {standard_task_runner.py:75} INFO - Job 8: Subtask
puller
[2020-11-18 10:29:04,477] {logging_mixin.py:103} INFO - Running
<TaskInstance: example_xcom.puller 2020-11-18T10:28:58.185921+00:00 [running]>
on host 557abba307a4
[2020-11-18 10:29:04,540] {taskinstance.py:1402} ERROR - XComArg result from
push at example_xcom with key="value_from_pusher 1"" is not found!
Traceback (most recent call last):
File "/opt/airflow/airflow/models/taskinstance.py", line 1087, in
_run_raw_task
self._prepare_and_execute_task_with_callbacks(context, task)
File "/opt/airflow/airflow/models/taskinstance.py", line 1224, in
_prepare_and_execute_task_with_callbacks
self.render_templates(context=context)
File "/opt/airflow/airflow/models/taskinstance.py", line 1690, in
render_templates
self.task.render_template_fields(context)
File "/opt/airflow/airflow/models/baseoperator.py", line 857, in
render_template_fields
self._do_render_template_fields(self, self.template_fields, context,
jinja_env, set())
File "/opt/airflow/airflow/models/baseoperator.py", line 870, in
_do_render_template_fields
rendered_content = self.render_template(content, context, jinja_env,
seen_oids)
File "/opt/airflow/airflow/models/baseoperator.py", line 921, in
render_template
return [self.render_template(element, context, jinja_env) for element in
content]
File "/opt/airflow/airflow/models/baseoperator.py", line 921, in <listcomp>
return [self.render_template(element, context, jinja_env) for element in
content]
File "/opt/airflow/airflow/models/baseoperator.py", line 909, in
render_template
return content.resolve(context)
File "/opt/airflow/airflow/models/xcom_arg.py", line 133, in resolve
raise AirflowException(
airflow.exceptions.AirflowException: XComArg result from push at
example_xcom with key="value_from_pusher 1"" is not found!
[2020-11-18 10:29:04,554] {taskinstance.py:1439} INFO - Marking task as
FAILED. dag_id=example_xcom, task_id=puller, execution_date=20201118T102858,
start_date=20201118T102904, end_date=20201118T102904
[2020-11-18 10:29:04,615] {local_task_job.py:118} INFO - Task exited with
return code 1
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]