mik-laj commented on a change in pull request #14306:
URL: https://github.com/apache/airflow/pull/14306#discussion_r579784091



##########
File path: airflow/api_connexion/schemas/dag_schema.py
##########
@@ -82,6 +83,18 @@ class DAGDetailSchema(DAGSchema):
     doc_md = fields.String(dump_only=True)
     default_view = fields.String(dump_only=True)
     params = fields.Dict(dump_only=True)
+    is_paused = fields.Method("get_is_paused", dump_only=True)
+    is_active = fields.Method("get_is_active", dump_only=True)
+
+    @staticmethod
+    def get_is_paused(obj: DAG):
+        """Checks entry in DAG table to see if this DAG is paused"""
+        return obj.get_is_paused()
+
+    @staticmethod
+    def get_is_active(obj: DAG):
+        """Checks entry in DAG table to see if this DAG is active"""
+        return obj.get_is_active()

Review comment:
       We have n+1 problem here. Am I right? This is a bit inefficient since 
the default page limit is 200 elements, so we have 201 queries here.  Can we 
optimize this to consume fewer queries?




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


Reply via email to