mik-laj commented on a change in pull request #4605: [AIRFLOW-3341] FAQ return 
DAG object example
URL: https://github.com/apache/airflow/pull/4605#discussion_r255552256
 
 

 ##########
 File path: docs/faq.rst
 ##########
 @@ -147,10 +147,21 @@ simple dictionary.
 
 .. code:: python
 
+    def create_dag(dag_id):
+        """
+        A function returning a DAG object.
+        """
+
+        return DAG(dag_id)
+
+
     for i in range(10):
         dag_id = 'foo_{}'.format(i)
         globals()[dag_id] = DAG(dag_id)
+
         # or better, call a function that returns a DAG object!
+        other_dag_id = 'dag_id_{}'.format('returned')
 
 Review comment:
   ```suggestion
           other_dag_id = 'bar_{}'.format(i)
   ```
   dag id must be unique.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to