SameerMesiah97 commented on code in PR #69185:
URL: https://github.com/apache/airflow/pull/69185#discussion_r3507374269
##########
airflow-core/src/airflow/models/dag_version.py:
##########
@@ -235,3 +235,21 @@ def get_version(
def version(self) -> str:
"""A human-friendly representation of the version."""
return f"{self.dag_id}-{self.version_number}"
+
+
+def resolve_pinned_version_data(
+ 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.
Review Comment:
Sam here. I would keep the first line. Leave any detailed explanations for
the comments.
##########
airflow-core/src/airflow/callbacks/callback_requests.py:
##########
@@ -46,6 +46,12 @@ class BaseCallbackRequest(BaseModel):
"""File Path to use to run the callback"""
bundle_name: str
bundle_version: str | None
+ version_data: dict[str, Any] | None = None
+ """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.
Review 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.
##########
airflow-core/src/airflow/models/dag_version.py:
##########
@@ -235,3 +235,21 @@ def get_version(
def version(self) -> str:
"""A human-friendly representation of the version."""
return f"{self.dag_id}-{self.version_number}"
+
+
+def resolve_pinned_version_data(
Review 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 is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]