ashb commented on a change in pull request #6348: [AIRFLOW-XXX] GSoD: Adding 
'Create a custom operator' doc
URL: https://github.com/apache/airflow/pull/6348#discussion_r336949680
 
 

 ##########
 File path: docs/howto/custom-operator.rst
 ##########
 @@ -60,15 +60,24 @@ You can now use the derived custom operator as follows:
 
 .. code:: python
 
-    hello_task = HelloOperator(task_id='sample-task', dag=dag, name='foo_bar')
+    from custom_operator.hello_operator import HelloOperator
+
+    with dag:
+        hello_task = HelloOperator(task_id='sample-task', name='foo_bar')
+
+**Note**: For imports to work, you should place the file in a directory that
 
 Review comment:
   This note should be against the previous snippet, not the dag one :)
   
   Oh and also this should be `.. note::` 
https://thomas-cokelaer.info/tutorials/sphinx/rest_syntax.html#colored-boxes-note-seealso-todo-and-warnings

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to