Initialize versioned Dag bundle for callbacks when bundle_version is None#69087
Open
nikolauspschuetz wants to merge 1 commit into
Open
Initialize versioned Dag bundle for callbacks when bundle_version is None#69087nikolauspschuetz wants to merge 1 commit into
nikolauspschuetz wants to merge 1 commit into
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes callback-only Dag processing when bundle versioning is disabled (so callback requests carry bundle_version=None) by ensuring versioning-capable Dag bundles are still initialized, allowing bundle.path to be resolved before queueing callbacks.
Changes:
- Initialize bundles for callbacks whenever
bundle.supports_versioning, even whenrequest.bundle_version is None. - Add unit tests covering initialization and resolved
bundle.pathbehavior forbundle_version=None. - Add a bugfix newsfragment documenting the change.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| airflow-core/src/airflow/dag_processing/manager.py | Initialize versioning-capable bundles for callbacks even when bundle_version is None, ensuring bundle.path is resolved before building DagFileInfo. |
| airflow-core/tests/unit/dag_processing/test_manager.py | Adds/updates tests to validate initialization and resolved bundle paths for callback requests with bundle_version=None. |
| airflow-core/newsfragments/64891.bugfix.rst | Documents the bugfix in the release notes. |
0777775 to
de5197c
Compare
…None When bundle versioning is disabled, DagRun.produce_dag_callback() sets bundle_version to None on the callback request. Callback queueing then skipped bundle.initialize() for versioning-capable bundles, so the queued DagFileInfo was built from an unresolved bundle path. Initialize the bundle whenever it supports versioning, letting it resolve its current effective version, so callbacks always queue a usable path.
de5197c to
1bf4400
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When bundle versioning is disabled (
disable_bundle_versioning=True),DagRun.produce_dag_callback()setsbundle_version=Noneon the callback request.DagFileProcessorManager.prepare_callback_bundle()then skippedbundle.initialize()for versioning-capable bundles because the guard required a truthyrequest.bundle_version. As a result,_add_callback_to_queue()builtDagFileInfofrom an unresolvedbundle.path(observed as/dev/nullfor backends whose path is only valid after initialization).This initializes the bundle whenever it supports versioning — even when
bundle_versionisNone— so the bundle resolves its current effective version and callbacks always queue a usable path. The normal versioned path and the non-versioning path are unchanged.closes: #64891
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.8) following the guidelines