class_docstr: TaskReschedule tracks rescheduled task instances.
docstr: Return all task reschedules for the task instance and try number, in ascending order.
  
  :param session: the database session object
  :param task_instance: the task instance to find task reschedules for
  :param try_number: Look for TaskReschedule of the given try_number. Default is None which
      looks for the same try_number of the given task_instance.
docstr_tok: ["Return","all","task","reschedules","for","the","task","instance","and","try","number",",","in","ascending","order",".",":","param","session",":","the","database","session","object",":","param","task_instance",":","the","task","instance","to","find","task","reschedules","for",":","param","try_number",":","Look","for","TaskReschedule","of","the","given","try_number",".","Default","is","None","which","looks","for","the","same","try_number","of","the","given","task_instance","."]
code: def find_for_task_instance(
      task_instance: TaskInstance,
      session: Session = NEW_SESSION,
      try_number: int | None = None,
  ) -> list[TaskReschedule]:
      """
      Return all task reschedules for the task instance and try number, in ascending order.
  
      :param session: the database session object
      :param task_instance: the task instance to find task reschedules for
      :param try_number: Look for TaskReschedule of the given try_number. Default is None which
          looks for the same try_number of the given task_instance.
      """
      warnings.warn(
          "Using this method is no longer advised, and it is expected to be removed in the future.",
          category=RemovedInAirflow3Warning,
          stacklevel=2,
      )
      return session.scalars(
          TaskReschedule.stmt_for_task_instance(
              ti=task_instance, try_number=try_number, descending=False
          )
      ).all()
  
file_path: airflow/airflow/models/taskreschedule.py
imports: from __future__ import annotations
  import warnings
  from typing import TYPE_CHECKING
  from sqlalchemy import Column, ForeignKeyConstraint, Index, Integer, String, asc, desc, select, text
  from sqlalchemy.ext.associationproxy import association_proxy
  from sqlalchemy.orm import relationship
  from airflow.exceptions import RemovedInAirflow3Warning
  from airflow.models.base import COLLATION_ARGS, ID_LEN, TaskInstanceDependencies
  from airflow.utils.session import NEW_SESSION, provide_session
  from airflow.utils.sqlalchemy import UtcDateTime
label_desc: Use image node_id 4 for calling the TaskReschedule obj's underlying member method code with example usage: obj.find_for_task_instance(task_instance, session, try_number) and returns: session