kik-kik commented on a change in pull request #4605: [AIRFLOW-3341] FAQ return
DAG object example
URL: https://github.com/apache/airflow/pull/4605#discussion_r264733708
##########
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:
Apologies for the late response, been away on a long holiday and after had
loads on my plate.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services