Skip to content

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

Merged
uranusjr merged 7 commits into
apache:mainfrom
jroachgolf84:feature/issue-68575
Jun 29, 2026
Merged

feature/issue-68575: Add bundle_name to Dag#68583
uranusjr merged 7 commits into
apache:mainfrom
jroachgolf84:feature/issue-68575

Conversation

@jroachgolf84

@jroachgolf84jroachgolf84 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).

@hookimpldefdag_policy(dag: DAG):
ifdag.bundle_name=="example_dags":
return# skip validating example dagsifdag.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.

fromairflow.sdkimportDAG, taskfromdatetimeimportdatetimewithDAG(
dag_id="feature_issue_68575",
start_date=datetime(2026, 1, 1),
schedule="@once"
) asdag:
@taskdefoutput_dag_bundle_name(**context):
_dag=context.get("dag")
return_dag.bundle_nameoutput_dag_bundle_name()
image

@jroachgolf84jroachgolf84 added the ready for maintainer review Set after triaging when all criteria pass. label Jun 17, 2026
@github-actions

github-actionsBot 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.

@henry3260henry3260 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me!

Comment threadairflow-core/src/airflow/dag_processing/dagbag.py Outdated
Comment threadairflow-core/tests/unit/dag_processing/test_dagbag.py

@henry3260henry3260 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@uranusjr
uranusjr merged commit 52cd4e5 into apache:mainJun 29, 2026
102 checks passed
karenbraganz pushed a commit to karenbraganz/airflow that referenced this pull request Jun 30, 2026
Co-authored-by: Henry Chen <henryhenry0512@gmail.com>
@vatsrahul1001vatsrahul1001 added this to the Airflow 3.4.0 milestone Aug 17, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:DAG-processingarea:task-sdkready for maintainer reviewSet after triaging when all criteria pass.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add bundle_name to Dag objects

4 participants

@jroachgolf84@henry3260@uranusjr@vatsrahul1001