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


##########
docs/apache-airflow/concepts/operators.rst:
##########
@@ -127,12 +132,12 @@ Deep nested fields can also be substituted, as long as 
all intermediate fields a
         # [additional code here...]
 
 
-    t = PythonOperator(
-        task_id="transform_data",
-        python_callable=transform_data,
-        op_args=[MyDataTransformer(MyDataReader("/tmp/{{ ds }}/my_file"))],
-        dag=dag,
-    )
+    @task(task_id="transform_data")
+    def transform_data(data_transformer):
+        pass
+
+
+    t = transform_data([MyDataTransformer(MyDataReader("/tmp/{{ ds 
}}/my_file"))])

Review Comment:
   I see @uranusjr 
   Then saying `@task` decorator as alternative to classic usage of Operator is 
not correct in this case. Am i right?
   
   Also we are passing the `op_args` for PythonOperator as  
`[MyDataTransformer(MyDataReader("/tmp/{{ ds }}/my_file"))]`. Does this part 
gets executed and passed to the python_callable function mentioned in the 
operator?



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