You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/02/19 20:53:19 UTC

[GitHub] [airflow] XD-DENG commented on a change in pull request #14306: Adding `only_active` parameter to /dags endpoint

XD-DENG commented on a change in pull request #14306:
URL: https://github.com/apache/airflow/pull/14306#discussion_r579468102



##########
File path: airflow/api_connexion/openapi/v1.yaml
##########
@@ -377,6 +377,12 @@ paths:
       parameters:
         - $ref: '#/components/parameters/PageLimit'
         - $ref: '#/components/parameters/PageOffset'
+        - name: only_active
+          in: query
+          schema:

Review comment:
       may be good to specify the `default` field here as well.

##########
File path: airflow/api_connexion/openapi/v1.yaml
##########
@@ -1459,6 +1465,10 @@ components:
           type: boolean
           nullable: true
           description: Whether the DAG is paused.
+        is_active:
+          type: boolean
+          nullable: true
+          description: Whether the DAG is currently seen by the schedulers.

Review comment:
       ```suggestion
             description: Whether the DAG is currently seen by the scheduler(s).
   ```
   
   nit.

##########
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):

Review comment:
       an open question: do we need two methods here? It's a "yes or no", so maybe just `get_is_active()` + `not get_is_active()` would already suffice?




----------------------------------------------------------------
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:
users@infra.apache.org