@provide_session<EOL><INDENT>def get_task_instances(self, start_date=None, end_date=None, session=None):<DEDENT>
end_date = end_date or timezone.utcnow()<EOL>return session.query(TaskInstance).filter(TaskInstance.dag_id == self.dag_id).filter(TaskInstance.task_id == self.task_id).filter(TaskInstance.execution_date >= start_date).filter(TaskInstance.execution_date <= end_date).order_by(TaskInstance.execution_date).all()<EOL>
Get a set of task instance related to this task for a specific date
range.