Skip to content

feature/issue-68575: Add bundle_name to Dag#68583

Open
jroachgolf84 wants to merge 5 commits into
apache:mainfrom
jroachgolf84:feature/issue-68575
Open

feature/issue-68575: Add bundle_name to Dag#68583
jroachgolf84 wants to merge 5 commits into
apache:mainfrom
jroachgolf84:feature/issue-68575

Conversation

@jroachgolf84

@jroachgolf84 jroachgolf84 commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR adds bundle_name to Dag. Per #68575, having bundle_name available would allow for it to be used for things like writing Cluster Policies (snipped of code below).

@hookimpl
def dag_policy(dag: DAG):
    if dag.bundle_name == "example_dags":
        return # skip validating example dags
    if dag.bundle_name == "special_dags":
         ... # special dag policy

closes: #68575

Testing

Three new unit-tests were added as part of this effort. These can be run using the commands below:

breze testing task-sdk-tests task-sdk/tests/task_sdk/definitions/test_dag.py

breeze testing core-tests airflow-core/tests/unit/dag_processing/test_dagbag.py

The below Dag was written to validate that the bundle name was available and correct.

from airflow.sdk import DAG, task
from datetime import datetime

with DAG(
    dag_id="feature_issue_68575",
    start_date=datetime(2026, 1, 1),
    schedule="@once"
) as dag:

    @task
    def output_dag_bundle_name(**context):
        _dag = context.get("dag")
        return _dag.bundle_name

    output_dag_bundle_name()
image

@jroachgolf84 jroachgolf84 requested a review from XD-DENG as a code owner June 16, 2026 22:25
@jroachgolf84 jroachgolf84 added the ready for maintainer review Set after triaging when all criteria pass. label Jun 17, 2026
@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

uv.lock on main just moved via #68642 ("Prepare provider documentation 2026-06-16"), commit 0236c57 and this PR currently conflicts.

Quickest fix:

git fetch upstream main && git rebase upstream/main
rm uv.lock && uv lock
git add uv.lock && git rebase --continue
git push --force-with-lease

Automated nudge — ignore if you're not ready to rebase. This comment is updated in place on future uv.lock bumps.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add bundle_name to Dag objects

1 participant