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 2023/01/03 23:46:13 UTC

[GitHub] [airflow] hussein-awala opened a new pull request, #28713: Add a param for get_dags endpoint to list only unpaused dags

hussein-awala opened a new pull request, #28713:
URL: https://github.com/apache/airflow/pull/28713

   Add a param for `get_dags` endpoint to filter paused dags and list only unpaused dags.
   (Stack Overflow [question](https://stackoverflow.com/questions/74992921/airflow-api-get-all-unpaused-running-dags/7499879))


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] hussein-awala commented on pull request #28713: Add a param for get_dags endpoint to list only unpaused dags

Posted by "hussein-awala (via GitHub)" <gi...@apache.org>.
hussein-awala commented on PR #28713:
URL: https://github.com/apache/airflow/pull/28713#issuecomment-1399067293

   @ashb I just added the tests, can you re-check please?


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] bbovenzi commented on pull request #28713: Add a param for get_dags endpoint to list only unpaused dags

Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on PR #28713:
URL: https://github.com/apache/airflow/pull/28713#issuecomment-1414100779

   @hussein-awala Could you rebase and regenerate the yaml and typescript files please?


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] hussein-awala commented on pull request #28713: Add a param for get_dags endpoint to list only unpaused dags

Posted by "hussein-awala (via GitHub)" <gi...@apache.org>.
hussein-awala commented on PR #28713:
URL: https://github.com/apache/airflow/pull/28713#issuecomment-1414122546

   @bbovenzi done


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] bbovenzi merged pull request #28713: Add a param for get_dags endpoint to list only unpaused dags

Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi merged PR #28713:
URL: https://github.com/apache/airflow/pull/28713


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] ephraimbuddy commented on a diff in pull request #28713: Add a param for get_dags endpoint to list only unpaused dags

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on code in PR #28713:
URL: https://github.com/apache/airflow/pull/28713#discussion_r1061211951


##########
airflow/api_connexion/openapi/v1.yaml:
##########
@@ -4920,6 +4921,18 @@ components:
 
         *New in version 2.1.1*
 
+    OnlyUnpaused:
+      in: query
+      name: only_unpaused
+      schema:
+        type: boolean
+        default: false
+      required: false
+      description: |
+        Only filter unpaused DAGs.
+
+        *New in version 2.5.1*

Review Comment:
   ```suggestion
           *New in version 2.6.0*
   ```



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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] ashb commented on a diff in pull request #28713: Add a param for get_dags endpoint to list only unpaused dags

Posted by GitBox <gi...@apache.org>.
ashb commented on code in PR #28713:
URL: https://github.com/apache/airflow/pull/28713#discussion_r1061586963


##########
airflow/api_connexion/endpoints/dag_endpoint.py:
##########
@@ -74,14 +74,15 @@ def get_dags(
     tags: Collection[str] | None = None,
     dag_id_pattern: str | None = None,
     only_active: bool = True,
+    only_unpaused: bool = False,

Review Comment:
   This is a bit of a double negative here which we should avoid
   
   Also it's not possible to list _only_ paused dags.
   
   How about instead we have
   
   `paused: bool | None = None` -- if it's None we don't filter, otherwise we filter by the given value?



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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] hussein-awala commented on a diff in pull request #28713: Add a param for get_dags endpoint to list only unpaused dags

Posted by GitBox <gi...@apache.org>.
hussein-awala commented on code in PR #28713:
URL: https://github.com/apache/airflow/pull/28713#discussion_r1061917772


##########
airflow/api_connexion/endpoints/dag_endpoint.py:
##########
@@ -74,14 +74,15 @@ def get_dags(
     tags: Collection[str] | None = None,
     dag_id_pattern: str | None = None,
     only_active: bool = True,
+    only_unpaused: bool = False,

Review Comment:
   I agree, my first thought was to do exactly what you're suggesting, but I implemented `only_unpaused` to continue in the same pattern. I will update it



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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org