Skip to content

Add has_import_errors filter to Core API GET /dags endpoint #53536

@AryanK1511

Description

@AryanK1511

Description

The core FastAPI GET /dags endpoint provides several query parameters to filter the list of DAGs returned. This allows users to find specific DAGs based on criteria like tags, owners, or paused status.

The Problem

Currently, there is no way to filter DAGs based on whether they have import errors. The DagModel has a has_import_errors property, but this is not exposed as a filter in the API.

Proposed Solution

I propose adding a new boolean query parameter, has_import_errors, to the GET /dags endpoint located at airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py.

  • GET /api/v1/dags?has_import_errors=true should return only DAGs with import errors.
  • GET /api/v1/dags?has_import_errors=false should return only DAGs without import errors.

Use case/motivation

This functionality is crucial to fix #53041. Once this is implemented, the UI filter functionality will be built on top of this.

Related issues

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions