Skip to content

Bundle version in dag_version table not updated when DAG code changes do not trigger a new dag_version #49606

Description

@vatsrahul1001

Apache Airflow version

3.0.0

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

No response

What happened?

The bundle_version field in the dag_version table is not updated when DAG code changes do not trigger a new dag_version.

For example, making a minor code change like adding a print statement does not create a new dag_version, but it does create a new bundle_version in the dag_bundle table. However, this updated bundle_version is not reflected in the dag_version table.

As a result, the UI continues to show the older bundle_version, even though the new DAG code is picked up during execution

What you think should happen instead?

The bundle_version field in the dag_version table should be updated regardless of whether a new dag_version is created, to reflect the most recent DAG code and avoid misleading information in the UI.

How to reproduce

  1. Create a git dag bundle.
  2. Update a print statement in dag
  3. Verify In UI or dag_version table still old bundle version is reflecting

Operating System

Linux

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

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

Activity

  1. added
    kind:bugThis is a clearly a bug
    needs-triagelabel for new issues that we didn't triage yet
    priority:mediumBug that should be fixed before next release but would not block a release
    and removed
    needs-triagelabel for new issues that we didn't triage yet
    on Apr 23, 2025
  2. added
    area:UIRelated to UI/UX. For Frontend Developers.
    on Apr 23, 2025
  3. added this to the Airflow 3.0.1 milestone on Apr 23, 2025
  4. added
    priority:highHigh priority bug that should be patched quickly but does not require immediate new release
    and removed
    priority:mediumBug that should be fixed before next release but would not block a release
    on Apr 24, 2025
  5. dstandish commented on Apr 24, 2025

    @dstandish
    Contributor

    What you think should happen instead?
    The bundle_version field in the dag_version table should be updated regardless of whether a new dag_version is created, to reflect the most recent DAG code and avoid misleading information in the UI.

    Or perhaps we should create a new dagversion record if EITHER dag code changes OR bundle version changes.

  6. Felix-neko commented on Apr 29, 2025

    @Felix-neko

    Or perhaps we should create a new dagversion record if EITHER dag code changes OR bundle version changes.

    I think that this behaviour could be configurable: airflow could delete the DAG from previous bundle version and create a new DAG by default -- and keep it and just create another version if corresponding field in airflow.cfg is enabled.

    But if it's hard to implement -- just for now airflow could just delete previous DAG every time if there is not DAG with such name in new bundle version.

    P.S. We also need this fix, it's really useful.

  7. dstandish commented on Apr 29, 2025

    @dstandish
    Contributor

    So this was initially reported as an issue because someone tried to infer the bundle version of a dag run from the DagVersion records associated with the DagRun.

    This is not the correct way to get this information.

    The correct way is to look at the bundle version stamped on the DagRun.

    The problem was that bundle_version was not included in the API responses returning DagRun objects.

    That was fixed here: #49726

    So, I think there is nothing to do here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

affected_version:3.0Issues Reported for 3.0area:UIRelated to UI/UX. For Frontend Developers.area:corekind:bugThis is a clearly a bugpriority:highHigh priority bug that should be patched quickly but does not require immediate new release

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions