hkc-8010 commented on code in PR #68012:
URL: https://github.com/apache/airflow/pull/68012#discussion_r4238723228


##########
task-sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -679,6 +679,12 @@ def get_first_reschedule_date(self, context: Context) -> 
AwareDatetime | None:
             # If the task has not been rescheduled, there is no need to ask 
the supervisor
             return None
 
+        if from_server := self._ti_context_from_server:
+            # Servers older than the 2026-10-30 API version omit this, so fall 
through to
+            # asking the supervisor below.

Review Comment:
   Dropped the date, the comment now just says older servers don't send the 
field (2447fd1b08).



##########
task-sdk/tests/task_sdk/execution_time/schema/test_migrator.py:
##########
@@ -501,3 +502,75 @@ def 
test_upgrade_fills_missing_retry_reason_with_none(self, real_migrator):
         body = {"type": "TaskState", "state": "failed", "end_date": None, 
"rendered_map_index": None}
         out = real_migrator.upgrade(body, TaskState, "2026-06-16")
         assert out["retry_reason"] is None
+
+
+class TestRealBundleFirstTaskRescheduleStartDate:
+    """
+    Drive the *real* supervisor bundle through the 
``first_task_reschedule_start_date`` migration.
+
+    ``AddFirstTaskRescheduleStartDateToSupervisorTIRunContext`` is 
``didnt_exist``-only, so the
+    downgrade re-validation is the only place it is visible: dropping it from 
the bundle, or
+    registering it under the wrong version, leaves the field on the wire for a 
pinned runtime.
+    """
+
+    FIRST_RESCHEDULE = datetime.datetime(2026, 1, 1, 
tzinfo=datetime.timezone.utc)
+
+    @pytest.fixture
+    def startup_details(self):
+        import uuid
+
+        from airflow.sdk.api.datamodels._generated import (
+            BundleInfo,
+            DagRun,
+            DagRunState,
+            DagRunType,
+            TaskInstance,
+            TIRunContext,
+        )
+        from airflow.sdk.execution_time.comms import StartupDetails

Review Comment:
   Moved them to module level (2447fd1b08).



##########
task-sdk/src/airflow/sdk/execution_time/schema/schema.json:
##########
@@ -5113,6 +5113,19 @@
           "title": "Task Reschedule Count",
           "type": "integer"
         },
+        "first_task_reschedule_start_date": {

Review Comment:
   Jarek fixed this in fab4d190ee (ec8b421839 after today's rebase). The TS SDK 
also vendors this schema now since #74415, so 2447fd1b08 syncs 
`ts-sdk/schema/supervisor-schema.json` too.



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