ferruzzi commented on code in PR #63657:
URL: https://github.com/apache/airflow/pull/63657#discussion_r3102948458


##########
providers/amazon/src/airflow/providers/amazon/aws/executors/ecs/ecs_executor.py:
##########
@@ -365,11 +367,11 @@ def __handle_failed_task(self, task_arn: str, reason: 
str):
             )
         else:
             self.log.error(
-                "Airflow task %s has failed a maximum of %s times. Marking as 
failed",
+                "Airflow workload %s has failed a maximum of %s times. Marking 
as failed",
                 task_key,
                 failure_count,
             )
-            self.fail(task_key)
+            self.fail(cast("TaskInstanceKey", task_key))

Review Comment:
   Once https://github.com/apache/airflow/pull/65392 merges I think you can 
drop this and the other places you used `cast()`.  Same for the places where 
you used `isinstance(task_key, tuple)`



##########
providers/amazon/src/airflow/providers/amazon/aws/executors/ecs/ecs_executor.py:
##########
@@ -131,30 +133,30 @@ def __init__(self, *args, **kwargs):
             fallback=CONFIG_DEFAULTS[AllEcsConfigKeys.MAX_RUN_TASK_ATTEMPTS],
         )
 
-    def queue_workload(self, workload: workloads.All, session: Session | None) 
-> None:
-        from airflow.executors import workloads
+    def _process_workloads(self, workloads: Sequence[workloads.All]) -> None:
+        from airflow.executors import workloads as wl

Review Comment:
   ```suggestion
       def _process_workloads(self, workload_items: Sequence[workloads.All]) -> 
None:
           from airflow.executors import workloads
   ```
   
   You needed the `import ... as` because you used the same name for the 
parameter.  Rename the parameter and you don't need the added confusion of the 
`as`.



##########
providers/amazon/src/airflow/providers/amazon/aws/executors/ecs/ecs_executor.py:
##########
@@ -262,10 +264,10 @@ def sync(self):
             self.log.exception("Failed to sync %s", self.__class__.__name__)
 
     def sync_running_tasks(self):

Review Comment:
   I think we need to rename these methods and the pending_tasks property then 
add a compat shim that is just the old name calling the new.  I think anything 
with a dunder is fine to straight rename, but the rest need a shim.



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