Skip to content

Dags list/list-import-errors cli commands broken and don't track local DagBag #49330

@dheerajturaga

Description

@dheerajturaga

Apache Airflow version

3.0.0

If "Other Airflow 2 version" selected, which one?

No response

What happened?

When developing dags, airflow dags list and airflow dags list-import-errors return No data found when the database has just been initialized. Also any update to the dags aren't reflected with these commands unless you run airflow dags reserialize. THe command only reads from db, it should also track localdag bag similar to airflow 2. This is a serious problem as these commands are used widely in dag development.

This is happening because these commands are reading from the db rather than tracking the local dagbag.
DagBag(read_dags_from_db=True)

What you think should happen instead?

Given we are always reading from the db in the case of list and list-import-errors we need to run reserialize before fetching these values from the database

How to reproduce

Seed a basic dag in the dags directory and run. Just use the defaults.

airflow db migrate
airflow dags list

Operating System

Ubuntu 24.04.1 LTS

Versions of Apache Airflow Providers

No response

Deployment

Virtualenv installation

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions