iamapez opened a new pull request, #58207:
URL: https://github.com/apache/airflow/pull/58207

   ## Summary
   Fixes #58205
   
   The `try_adopt_task_instances` method in the ECS Executor was calling 
`ti.command_as_list()` which doesn't exist in Airflow 3.x due to Task SDK 
changes. This caused the scheduler to crash with `AttributeError` when trying 
to adopt orphaned ECS tasks.
   
   ## The Problem
   - In Airflow 3.x, the `TaskInstance.command_as_list()` method was removed as 
part of the Task SDK refactoring
   - The ECS Executor's `try_adopt_task_instances` method still calls this 
non-existent method at line 598
   - This causes immediate scheduler failure on startup when using ECS Executor 
with Airflow 3.x
   
   ## The Solution
   This PR adds version-aware code that:
   - Checks `AIRFLOW_V_3_0_PLUS` to determine the Airflow version
   - For Airflow 3.x: Reconstructs the command list manually from task instance 
attributes
   - For Airflow 2.x: Uses the existing `command_as_list()` method
   
   ## Testing
   - Python syntax validated with `py_compile`
   - The fix maintains backward compatibility with Airflow 2.x
   - Scheduler starts successfully with this fix applied to Airflow 3.1.1
   
   ## Checklist
   - [x] My code follows the style guidelines of this project
   - [x] I have commented my code, particularly in hard-to-understand areas  
   - [x] My changes generate no new warnings
   - [x] The fix is minimal and focused on the specific issue
   - [x] Maintains backward compatibility with Airflow 2.x


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