Skip to content

Fix airflowctl dagrun list limit handling (#64066)#64306

Closed
deepujain wants to merge 1 commit into
apache:mainfrom
deepujain:fix-64066-airflowctl-dagrun-limit
Closed

Fix airflowctl dagrun list limit handling (#64066)#64306
deepujain wants to merge 1 commit into
apache:mainfrom
deepujain:fix-64066-airflowctl-dagrun-limit

Conversation

@deepujain

Copy link
Copy Markdown
Contributor

Summary

airflowctl dagrun list was using the shared list paginator, which kept fetching and appending additional pages until it returned every matching run. That made --limit behave like a page size instead of a hard cap. This change makes DAG run listing return exactly the requested page and preserves the limit the user asked for.

Changes

  • airflow-ctl/src/airflowctl/api/operations.py -- changed DagRunOperations.list() to make a single API request and return the server response directly, so --limit is honored as the final result cap.
  • airflow-ctl/tests/airflow_ctl/api/test_operations.py -- added a regression test that verifies DAG run listing does not paginate past the first page when limit=1.

Test plan

  • uv run --project /Users/dejain/nvidia/oss/airflow-64066/airflow-ctl ruff check /Users/dejain/nvidia/oss/airflow-64066/airflow-ctl/src/airflowctl/api/operations.py /Users/dejain/nvidia/oss/airflow-64066/airflow-ctl/tests/airflow_ctl/api/test_operations.py
  • uv run --project /Users/dejain/nvidia/oss/airflow-64066/airflow-ctl ruff format --check /Users/dejain/nvidia/oss/airflow-64066/airflow-ctl/src/airflowctl/api/operations.py /Users/dejain/nvidia/oss/airflow-64066/airflow-ctl/tests/airflow_ctl/api/test_operations.py
  • uv run --project /Users/dejain/nvidia/oss/airflow-64066/airflow-ctl pytest /Users/dejain/nvidia/oss/airflow-64066/airflow-ctl/tests/airflow_ctl/api/test_operations.py::TestDagRunOperations -xvs

Fixes #64066

@deepujain

Copy link
Copy Markdown
Contributor Author

Closing this as duplicate of #64071.

@deepujain deepujain closed this Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

airflowctl: dagrun list --limit=N returns more results than limit number

1 participant