ultrabug commented on issue #2460: [AIRFLOW-1424] make the next execution date 
of DAGs visible
URL: 
https://github.com/apache/incubator-airflow/pull/2460#issuecomment-435914220
 
 
   Interesting to see this, the author of the CLI implementation assumed that 
there can't be a next schedule if there has not been any execution yet  
   
   ```python
               # `next_execution` function is inapplicable if no execution 
record found
               # It prints `None` in such cases
               self.assertEqual(stdout[-1], "None")
   ```
   
   which contradicts my implementation where when this is the case, I derive 
the first planned run date from the tasks and normalize it to calculate the 
actual first execution date: 
   
   ```python
       @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))
   ```
   
   @ashb @Fokko and all others, I must admit that I'm not sure which point of 
view is the right one here since the CLI implementation has been accepted in 
the code base already, does that mean that it's right?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to