You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/07/21 18:54:39 UTC

[GitHub] [airflow] josh-fell commented on a change in pull request #16868: Updating Amazon-AWS example DAGs to use XComArgs

josh-fell commented on a change in pull request #16868:
URL: https://github.com/apache/airflow/pull/16868#discussion_r674246186



##########
File path: airflow/providers/amazon/aws/example_dags/example_google_api_to_s3_transfer_advanced.py
##########
@@ -53,12 +53,13 @@
 
 
 # [START howto_operator_google_api_to_s3_transfer_advanced_task_1_2]
-def _check_and_transform_video_ids(xcom_key, task_ids, task_instance, **kwargs):
-    video_ids_response = task_instance.xcom_pull(task_ids=task_ids, key=xcom_key)
+def _check_and_transform_video_ids(xcom_key, task_output):
+    video_ids_response = task_output[xcom_key]
     video_ids = [item['id']['videoId'] for item in video_ids_response['items']]
 
     if video_ids:
-        task_instance.xcom_push(key='video_ids', value={'id': ','.join(video_ids)})
+        context = get_current_context()
+        context["task_instance"].xcom_push(key='video_ids', value={'id': ','.join(video_ids)})

Review comment:
       You're right, this was a miss! I'll update accordingly.  




-- 
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