Thread version_data to callbacks#69185
Open
o-nikolas wants to merge 2 commits into
Open
Conversation
PR apache#67217 wired version_data into the task execution path but not callbacks, so callbacks for a pinned run initialized their bundle without the manifest tasks used. Populate version_data on the callback producer paths (ExecuteCallback.make and the CallbackRequest creation sites) under the same pin guard as tasks, carry it on BaseCallbackRequest, and forward it through prepare_callback_bundle to get_bundle.
e3bace1 to
a9cf234
Compare
SameerMesiah97
left a comment
Contributor
There was a problem hiding this comment.
A few nits that you can choose to address. Otherwise, this looks good to me.
| """Optional structured metadata for the pinned bundle version (e.g. an S3 object manifest). | ||
|
|
||
| Populated only for pinned runs so the callback initializes the bundle against the same | ||
| version the task ran with; ``None`` for unpinned runs. |
Contributor
There was a problem hiding this comment.
I would keep only the first line. The docstring under each parameter is only intended to explain what the field is. Not its inner workings.
| dag_version: DagVersion | None, bundle_version: str | None | ||
| ) -> dict[str, Any] | None: | ||
| """ | ||
| Return a bundle version's ``version_data`` manifest, but only for pinned runs. |
Contributor
There was a problem hiding this comment.
Sam here. I would keep the first line. Leave any detailed explanations for the comments.
| return f"{self.dag_id}-{self.version_number}" | ||
|
|
||
|
|
||
| def resolve_pinned_version_data( |
Contributor
There was a problem hiding this comment.
Minor nit: should this be _resolve_pinned_version_data? It looks like an internal helper that's only used within Airflow itself, so I'm not sure it needs to be part of the module's public API. I would prefer _resolve_version_data to be more concise.
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.
PR #67217 wired version_data into the task execution path but not callbacks, so callbacks for a pinned run initialized their bundle without the manifest tasks used. Populate version_data on the callback producer paths (ExecuteCallback.make and the CallbackRequest creation sites) under the same pin guard as tasks, carry it on BaseCallbackRequest, and forward it through prepare_callback_bundle to get_bundle.
Was generative AI tooling used to co-author this PR?
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.