You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2018/10/22 10:35:28 UTC
[GitHub] ashb commented on a change in pull request #2460: [AIRFLOW-1424]
make the next execution date of DAGs visible
ashb commented on a change in pull request #2460: [AIRFLOW-1424] make the next execution date of DAGs visible
URL: https://github.com/apache/incubator-airflow/pull/2460#discussion_r226942255
##########
File path: airflow/models.py
##########
@@ -3055,6 +3055,37 @@ def latest_execution_date(self):
session.close()
return execution_date
+ @property
+ def next_run_date(self):
+ """
+ Returns the next run date for which the dag will be scheduled
+ """
+ next_run_date = None
+ if not self.latest_execution_date:
+ # First run
+ task_start_dates = [t.start_date for t in self.tasks]
+ if task_start_dates:
+ next_run_date = self.normalize_schedule(min(task_start_dates))
+ else:
+ next_run_date = self.following_schedule(self.latest_execution_date)
+ return next_run_date
+
+ @property
+ def next_execution_date(self):
+ """
+ Returns the next execution date at which the dag will be scheduled by
Review comment:
It's not clear to me how these two methods differ. What's the intent behind these two methods?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services