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


##########
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:
   BashOperator is probably a reasonable choice. PythonOperator works as well, 
but `@task` does not (it does not render templates; only operator _classes_ do 
this).
   
   Maybe we can revert this change back to PythonOperator in this PR, and 
rewrite it later.



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