Skip to content

Thread version_data to callbacks#69185

Open
o-nikolas wants to merge 2 commits into
apache:mainfrom
aws-mwaa:onikolas/pr3/s3-bundle-version-callbacks
Open

Thread version_data to callbacks#69185
o-nikolas wants to merge 2 commits into
apache:mainfrom
aws-mwaa:onikolas/pr3/s3-bundle-version-callbacks

Conversation

@o-nikolas

@o-nikolas o-nikolas commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

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?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {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.

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.
@o-nikolas o-nikolas force-pushed the onikolas/pr3/s3-bundle-version-callbacks branch from e3bace1 to a9cf234 Compare June 30, 2026 16:39

@SameerMesiah97 SameerMesiah97 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.

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.

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.

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.

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.

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(

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.

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.

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

Labels

area:DAG-processing area:Executors-core LocalExecutor & SequentialExecutor area:Scheduler including HA (high availability) scheduler area:Triggerer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants