vincbeck commented on code in PR #40761:
URL: https://github.com/apache/airflow/pull/40761#discussion_r1678041981


##########
airflow/providers/amazon/aws/executors/ecs/ecs_executor.py:
##########
@@ -385,18 +385,22 @@ def attempt_task_runs(self):
                     )
                     self.pending_tasks.append(ecs_task)
                 else:
-                    self.send_message_to_task_logs(
-                        logging.ERROR,
-                        "ECS task %s has failed a maximum of %s times. Marking 
as failed. Reasons: %s",
-                        task_key,
+                    reasons_str = ", ".join(failure_reasons)
+                    self.log.error(
+                        "ECS task %s has failed %s times. Marking as failed. 
Reasons: %s" % task_key,

Review Comment:
   ```suggestion
                           "ECS task %s has failed %s times. Marking as failed. 
Reasons: %s",
   ```
   
   And pass `task_key` as first parameter 



##########
airflow/api_connexion/schemas/event_log_schema.py:
##########
@@ -43,17 +44,41 @@ class Meta:
     extra = auto_field(dump_only=True)
 
 
+class TaskInstanceEventLogSchema(SQLAlchemySchema):
+    """Event log schema."""
+
+    class Meta:
+        """Meta."""
+
+        model = TaskInstanceEventLog
+
+    id = auto_field(data_key="event_log_id", dump_only=True)
+    dag_id = auto_field(dump_only=True)
+    task_id = auto_field(dump_only=True)
+    run_id = auto_field(dump_only=True)
+    map_index = auto_field(dump_only=True)
+    try_number = auto_field(dump_only=True)
+    event = auto_field(column_name="message", dump_only=True)
+
+
 class EventLogCollection(NamedTuple):
     """List of import errors with metadata."""
 
     event_logs: list[Log]
     total_entries: int
 
+class TaskInstanceEventLogCollection(NamedTuple):
+    """List of import errors with metadata."""

Review Comment:
   Copy pasta



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