itayweb commented on code in PR #61550:
URL: https://github.com/apache/airflow/pull/61550#discussion_r3100568589
##########
airflow-core/src/airflow/api_fastapi/execution_api/versions/v2026_04_06.py:
##########
@@ -178,6 +178,20 @@ def remove_note_field(response: ResponseInfo) -> None: #
type: ignore[misc]
response.body["dag_run"].pop("note", None)
+class AddBundleVersionField(VersionChange):
+ """Add the `bundle_version` field to DagRun model."""
+
+ description = __doc__
+
+ instructions_to_migrate_to_previous_version =
(schema(DagRun).field("bundle_version").didnt_exist,)
+
+ @convert_response_to_previous_version_for(TIRunContext) # type:
ignore[arg-type]
+ def remove_bundle_version_from_dag_run(response: ResponseInfo) -> None: #
type: ignore[misc]
+ """Remove the `bundle_version` field from the dag_run object when
converting to the previous version."""
+ if "dag_run" in response.body and isinstance(response.body["dag_run"],
dict):
+ response.body["dag_run"].pop("bundle_version", None)
+
Review Comment:
Done
##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_run.py:
##########
@@ -106,6 +106,7 @@ class TriggerDAGRunPostBody(StrictBaseModel):
conf: dict | None = Field(default_factory=dict)
note: str | None = None
partition_key: str | None = None
+ bundle_version: str | None = None
Review Comment:
Done
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py:
##########
@@ -487,6 +488,13 @@ def trigger_dag_run(
dag = get_latest_version_of_dag(dag_bag, dag_id, session)
params = body.validate_context(dag)
+ if body.bundle_version is not None:
+ if dag.disable_bundle_versioning:
+ raise HTTPException(
+ status.HTTP_400_BAD_REQUEST,
+ f"DAG with dag_id: '{dag_id}' does not support bundle
versioning",
+ )
+
Review Comment:
Done
--
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]