uranusjr commented on code in PR #25711:
URL: https://github.com/apache/airflow/pull/25711#discussion_r963960521


##########
docs/apache-airflow/concepts/operators.rst:
##########
@@ -183,25 +184,23 @@ you can pass ``render_template_as_native_obj=True`` to 
the DAG as follows:
     )
 
 
+    @task(task_id="extract")
     def extract():
         data_string = '{"1001": 301.27, "1002": 433.21, "1003": 502.22}'
         return json.loads(data_string)
 
 
+    @task(task_id="transform")
     def transform(order_data):
         print(type(order_data))
         for value in order_data.values():
             total_order_value += value
         return {"total_order_value": total_order_value}
 
 
-    extract_task = PythonOperator(task_id="extract", python_callable=extract)
+    extract_task = extract()
 
-    transform_task = PythonOperator(
-        task_id="transform",
-        op_kwargs={"order_data": "{{ti.xcom_pull('extract')}}"},
-        python_callable=transform,
-    )
+    transform_task = transform(order_data="{{ti.xcom_pull('extract')}}")

Review Comment:
   Same.



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

Reply via email to