XD-DENG commented on a change in pull request #6652: [AIRFLOW-5548] 
[AIRFLOW-5550] REST API enhancement - dag info, task …
URL: https://github.com/apache/airflow/pull/6652#discussion_r354141777
 
 

 ##########
 File path: airflow/api/common/experimental/__init__.py
 ##########
 @@ -45,3 +45,10 @@ def check_and_get_dagrun(dag: DagModel, execution_date: 
datetime) -> DagRun:
                          .format(execution_date, dag.dag_id))
         raise DagRunNotFound(error_message)
     return dagrun
+
+
+def check_and_get_dags():
+    """Get the dag ids present in the dagbag"""
+    dagbag = DagBag()
 
 Review comment:
   Calling `DagBag()` is a quite expensive action. You may want to get the list 
of dag ids from DB instead.
   
   On the other hand, my personal preference is not to have a new separate 
function if what you're doing inside is very straightforward & not being used 
at multiple locations (here this `check_and_get_dags()` function is only used 
at one location).

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

Reply via email to