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_r336950001
 
 

 ##########
 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
+is present in the ``PATH`` env. Airflow adds ``dags``, ``plugins``, and 
``config`` directories
 
 Review comment:
   In the python include path, not `PATH` (which is the system executable 
search path). Other than that this paragraph is correct.

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