o-nikolas commented on code in PR #58207:
URL: https://github.com/apache/airflow/pull/58207#discussion_r2520292254


##########
providers/amazon/src/airflow/providers/amazon/aws/executors/ecs/ecs_executor.py:
##########
@@ -591,11 +591,31 @@ def try_adopt_task_instances(self, tis: 
Sequence[TaskInstance]) -> Sequence[Task
 
                 for task in task_descriptions:
                     ti = next(ti for ti in tis if ti.external_executor_id == 
task.task_arn)
+
+                    # Handle Airflow 3.x (Task SDK) vs 2.x differences
+                    if AIRFLOW_V_3_0_PLUS:
+                        # In Airflow 3.x, we need to reconstruct the command 
from workload
+                        # For adopted tasks, we construct a basic command list
+                        # Note: execution_date was renamed to logical_date in 
Airflow 3.x
+                        command = [
+                            "airflow",
+                            "tasks",
+                            "run",
+                            ti.dag_id,
+                            ti.task_id,
+                            ti.logical_date.isoformat(),
+                        ]

Review Comment:
   Could consider making this a helper function now as well, instead of 
copy/pasting the implementation here.



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