'The task instance for the task that ran before this task instance'

@property
@provide_session
def previous_ti(self, session=None):

    dag = self.task.dag
    if dag:
        dr = self.get_dagrun(session=session)
        if (not dr):
            previous_scheduled_date = dag.previous_schedule(self.execution_date)
            if (not previous_scheduled_date):
                return None
            return TaskInstance(task=self.task, execution_date=previous_scheduled_date)
        dr.dag = dag
        if dag.catchup:
            last_dagrun = dr.get_previous_scheduled_dagrun(session=session)
        else:
            last_dagrun = dr.get_previous_dagrun(session=session)
        if last_dagrun:
            return last_dagrun.get_task_instance(self.task_id, session=session)
    return None
