class_docstr: TaskFail tracks the failed run durations of each task instance.
code: def __init__(self, ti):
      self.dag_id = ti.dag_id
      self.task_id = ti.task_id
      self.run_id = ti.run_id
      self.map_index = ti.map_index
      self.start_date = ti.start_date
      self.end_date = ti.end_date
      if self.end_date and self.start_date:
          self.duration = int(
              (self.end_date - self.start_date).total_seconds()
          )
      else:
          self.duration = None
  
file_path: airflow/airflow/models/taskfail.py
imports: from __future__ import annotations
  from sqlalchemy import Column, ForeignKeyConstraint, Index, Integer, text
  from sqlalchemy.orm import relationship
  from airflow.models.base import StringID, TaskInstanceDependencies
  from airflow.utils.sqlalchemy import UtcDateTime
label_desc: Use image node_id 1 to create a new TaskFail object from inherited base classes: TaskInstanceDependencies with example: obj = TaskFail(ti)