Khan3K opened a new pull request, #71473:
URL: https://github.com/apache/airflow/pull/71473
Adds a new `is_scheduled` query parameter to the public `GET /dags` API (and
the private UI `/dags` endpoint) to filter DAGs by scheduling status.
### What & why
Issue #53041 asks for the ability to identify unscheduled DAGs
("`schedule_interval = None` or equivalent") in the DAGs search UI, which
requires API support (#53741). Today you can filter by `timetable_type`, but
there is no simple boolean filter for "is this DAG scheduled?".
* `is_scheduled=false` returns DAGs that use the null timetable
(`schedule=None`)
* `is_scheduled=true` returns all other DAGs
* When omitted, behavior is unchanged
This follows the approach already discussed on the two prior (closed)
attempts for this issue:
* On #54382 and #58848, reviewers asked to implement this on top of the
`timetable_type` column added by #58852, which is now merged.
* On #58848, `pierrejeambrun` (maintainer) suggested: *"searching on
`timetable_type` is good enough for now ... non schedule is basically null
timetable filtering. And schedule is all but `is_null_timetable`."*
(`is_scheduled` will only work reliably for built-in timetables; a custom
timetable can be scheduled or unscheduled depending on its implementation —
documented in the parameter description).
### Changes
* `airflow/api_fastapi/common/parameters.py` — new `QueryIsScheduledFilter`
(`_IsScheduledFilter`) matching on `timetable_type == "NullTimetable"` /
otherwise
* `airflow/api_fastapi/core_api/routes/public/dags.py` +
`airflow/api_fastapi/core_api/routes/ui/dags.py` — wire the new filter into
both `/dags` endpoints
* Regenerated OpenAPI specs (`v2-rest-api-generated.yaml`,
`_private_ui.yaml`) and the UI API client (`airflow/ui/openapi-gen/`)
* Tests for the public and UI routes; newsfragment added
closes: #53741
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes (please specify the tool below)
Generated-by: big-pickle following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]