Skip to content

Add partition date filters to Dag run API - #68682

Merged
henry3260 merged 3 commits into
apache:mainfrom
henry3260:fix-airflowctl-dags-clear-partition-date
Jul 23, 2026
Merged

Add partition date filters to Dag run API#68682
henry3260 merged 3 commits into
apache:mainfrom
henry3260:fix-airflowctl-dags-clear-partition-date

Conversation

@henry3260

@henry3260 henry3260 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Why

This adds partition-date support to the public GET Dag runs API so clients can list partitioned Dag runs by local calendar day.

The GET /dags/{dag_id}/dagRuns endpoint now supports:

  • partition_date_start
  • partition_date_end
  • order_by=partition_date

This also updates the generated OpenAPI spec and UI client query types.

Related: #68706

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@boring-cyborg boring-cyborg Bot added area:airflow-ctl area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. backport-to-airflow-ctl/v0-1-test kind:documentation labels Jun 17, 2026
@henry3260
henry3260 force-pushed the fix-airflowctl-dags-clear-partition-date branch 2 times, most recently from 01286aa to daffc23 Compare June 18, 2026 06:25
@henry3260 henry3260 changed the title Add partition date filters to Dag run API and add airflowctl dags clear Add partition date filters to Dag run API Jun 18, 2026
@henry3260
henry3260 force-pushed the fix-airflowctl-dags-clear-partition-date branch from daffc23 to b83ca2a Compare June 18, 2026 09:25
@henry3260
henry3260 marked this pull request as ready for review June 18, 2026 13:05
@potiuk potiuk added the ready for maintainer review Set after triaging when all criteria pass. label Jun 22, 2026
@henry3260
henry3260 force-pushed the fix-airflowctl-dags-clear-partition-date branch from b83ca2a to 0850361 Compare June 25, 2026 09:42

@pierrejeambrun pierrejeambrun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

PR description isn't up to date. Added partition_date to DAGRunResponse ...

Comment thread airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py Outdated
Comment thread airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py Outdated
@henry3260
henry3260 force-pushed the fix-airflowctl-dags-clear-partition-date branch from 0850361 to 7ae4411 Compare July 1, 2026 17:03
@henry3260
henry3260 force-pushed the fix-airflowctl-dags-clear-partition-date branch from b4629b6 to fc2d0c1 Compare July 1, 2026 18:03
@henry3260

Copy link
Copy Markdown
Contributor Author

gentle ping @pierrejeambrun @bugraoz93 Could I get your review when you got a chance? Thanks!

@jason810496 jason810496 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py Outdated
Comment thread airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py Outdated
@henry3260
henry3260 force-pushed the fix-airflowctl-dags-clear-partition-date branch from fc2d0c1 to 336df74 Compare July 19, 2026 17:34
@henry3260
henry3260 requested review from XD-DENG and ashb as code owners July 19, 2026 17:34
@henry3260
henry3260 force-pushed the fix-airflowctl-dags-clear-partition-date branch from 336df74 to d79e0f1 Compare July 20, 2026 09:54
@henry3260
henry3260 requested a review from jason810496 July 20, 2026 12:58
Comment thread airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py Outdated
Comment thread airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py Outdated
Comment thread airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py Outdated
Comment thread airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py Outdated
henry3260 and others added 3 commits July 23, 2026 18:06
Runs of a non-partitioned Dag never carry a partition_date, so filtering
by partition_date_start/partition_date_end silently returned an empty
list, which reads as "no runs in that window" rather than "this Dag has
no partition dimension". Return 400 instead, mirroring how supplying a
partition_key for a non-partitioned Dag is rejected.
The other range filters on the list Dag runs endpoint use the _gte/_lte
suffix convention (start_date_gte, logical_date_lte, ...), so the new
partition date bounds should follow it too. Also clarify in the query
parameter descriptions that the inclusive bounds cover the whole
calendar day, and fold the partition-date branches into a single
condition so the 400 paths and the filter path read in one place.
@henry3260
henry3260 force-pushed the fix-airflowctl-dags-clear-partition-date branch from b5b63b4 to 3ab6954 Compare July 23, 2026 10:07
@henry3260
henry3260 requested a review from bbovenzi July 23, 2026 10:07
@henry3260

Copy link
Copy Markdown
Contributor Author

Applied all comments, waiting for your final review @bbovenzi :) THANKS

@bbovenzi bbovenzi added this to the Airflow 3.3.1 milestone Jul 23, 2026
@bbovenzi bbovenzi added backport-to-v3-3-test Backport to v3-3-test and removed ready for maintainer review Set after triaging when all criteria pass. labels Jul 23, 2026
@henry3260
henry3260 merged commit 8e6f28f into apache:main Jul 23, 2026
155 of 156 checks passed
@henry3260
henry3260 deleted the fix-airflowctl-dags-clear-partition-date branch July 23, 2026 14:55
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-3-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
v3-3-test PR Link

henry3260 added a commit that referenced this pull request Jul 23, 2026
* Add partition date support to Dag run API

* Reject partition date filters on non-partitioned Dags in Dag run API

Runs of a non-partitioned Dag never carry a partition_date, so filtering
by partition_date_start/partition_date_end silently returned an empty
list, which reads as "no runs in that window" rather than "this Dag has
no partition dimension". Return 400 instead, mirroring how supplying a
partition_key for a non-partitioned Dag is rejected.

* Rename Dag run partition date filters to partition_date_gte/lte

The other range filters on the list Dag runs endpoint use the _gte/_lte
suffix convention (start_date_gte, logical_date_lte, ...), so the new
partition date bounds should follow it too. Also clarify in the query
parameter descriptions that the inclusive bounds cover the whole
calendar day, and fold the partition-date branches into a single
condition so the 400 paths and the filter path read in one place.
(cherry picked from commit 8e6f28f)

Co-authored-by: Henry Chen <henrychen@apache.org>
vatsrahul1001 pushed a commit that referenced this pull request Aug 5, 2026
* Add partition date support to Dag run API

* Reject partition date filters on non-partitioned Dags in Dag run API

Runs of a non-partitioned Dag never carry a partition_date, so filtering
by partition_date_start/partition_date_end silently returned an empty
list, which reads as "no runs in that window" rather than "this Dag has
no partition dimension". Return 400 instead, mirroring how supplying a
partition_key for a non-partitioned Dag is rejected.

* Rename Dag run partition date filters to partition_date_gte/lte

The other range filters on the list Dag runs endpoint use the _gte/_lte
suffix convention (start_date_gte, logical_date_lte, ...), so the new
partition date bounds should follow it too. Also clarify in the query
parameter descriptions that the inclusive bounds cover the whole
calendar day, and fold the partition-date branches into a single
condition so the 400 paths and the filter path read in one place.
(cherry picked from commit 8e6f28f)

Co-authored-by: Henry Chen <henrychen@apache.org>
dabla pushed a commit to dabla/airflow that referenced this pull request Aug 14, 2026
* Add partition date support to Dag run API

* Reject partition date filters on non-partitioned Dags in Dag run API

Runs of a non-partitioned Dag never carry a partition_date, so filtering
by partition_date_start/partition_date_end silently returned an empty
list, which reads as "no runs in that window" rather than "this Dag has
no partition dimension". Return 400 instead, mirroring how supplying a
partition_key for a non-partitioned Dag is rejected.

* Rename Dag run partition date filters to partition_date_gte/lte

The other range filters on the list Dag runs endpoint use the _gte/_lte
suffix convention (start_date_gte, logical_date_lte, ...), so the new
partition date bounds should follow it too. Also clarify in the query
parameter descriptions that the inclusive bounds cover the whole
calendar day, and fold the partition-date branches into a single
condition so the 400 paths and the filter path read in one place.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. backport-to-v3-3-test Backport to v3-3-test kind:documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants