Copilot commented on code in PR #63524:
URL: https://github.com/apache/airflow/pull/63524#discussion_r2931492536


##########
airflow-core/src/airflow/api_fastapi/execution_api/versions/v2026_03_31.py:
##########
@@ -95,3 +95,14 @@ def ensure_start_date_in_dag_run(response: ResponseInfo) -> 
None:  # type: ignor
         """Ensure start_date is never None in direct DagRun responses for 
previous API versions."""
         if response.body.get("start_date") is None:
             response.body["start_date"] = response.body.get("run_after")
+
+
+class RemoveDagIdAndRunIdFromDagRun(VersionChange):
+    """Remove `dag_id` and `run_id` from DagRun model."""
+
+    description = __doc__
+
+    instructions_to_migrate_to_previous_version = (
+        schema(DagRun).field("dag_id").existed_as(type=str),
+        schema(DagRun).field("run_id").existed_as(type=str),
+    )

Review Comment:
   `RemoveDagIdAndRunIdFromDagRun` declares that `DagRun.dag_id`/`run_id` 
existed in previous API versions, but there is no 
`@convert_response_to_previous_version_for(...)` handler to actually add those 
fields back when downgrading responses. This likely breaks clients pinned to 
pre-2026-03-31 schemas, since responses will no longer contain required 
`dag_id`/`run_id` keys. Consider adding response conversion(s) (e.g. for 
`TIRunContext` and direct `DagRun` responses) to populate these fields from 
request/path context or other available data when converting to older versions.
   



##########
task-sdk/src/airflow/sdk/execution_time/comms.py:
##########
@@ -351,13 +351,9 @@ class AssetEventSourceTaskInstance:
     task_id: str
     map_index: int
 
-    @property
-    def dag_id(self) -> str:
-        return self.dag_run.dag_id
+    dag_id: str
 
-    @property
-    def run_id(self) -> str:
-        return self.dag_run.run_id
+    run_id: str
 

Review Comment:
   `AssetEventSourceTaskInstance` now requires explicit `dag_id`/`run_id` 
fields. There are still tests constructing 
`AssetEventSourceTaskInstance(dag_run=..., task_id=..., map_index=...)` without 
these args (e.g. `task-sdk/tests/task_sdk/execution_time/test_context.py`), 
which will start failing due to missing required attributes. Update those call 
sites/tests to pass `dag_id`/`run_id` (likely from the asset event reference’s 
`source_dag_id`/`source_run_id`).



-- 
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]

Reply via email to