ashb commented on a change in pull request #5372: [AIRFLOW-3057] add
prev_*_date_success to template context
URL: https://github.com/apache/airflow/pull/5372#discussion_r291538464
##########
File path: airflow/models/taskinstance.py
##########
@@ -528,25 +532,43 @@ def _get_previous_ti(self, session=None):
if not previous_scheduled_date:
return None
- return TaskInstance(task=self.task,
- execution_date=previous_scheduled_date)
+ 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)
+ if dag.catchup is False or state is not None or
dag.schedule_interval is None:
Review comment:
> E.g. I would say `previous_ti` should always give the absolute last ti
without regard to schedule, and we should make a separate property
`previous_scheduled_ti` for the last scheduled ti.
That sounds sensible for 2.0, yes. Can you reply to the post on the mailing
list about context params with this change/suggestion? (I'm planning to cherry
pick this PR to 1.10.4 once we get it merged, so we can't change the behaviour
yet)
Comments LGTM
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services