EricGao888 edited a comment on issue #19286:
URL: https://github.com/apache/airflow/issues/19286#issuecomment-975142729


   > The TODO comment hints what a proper solution would be. We should add a 
new field on `DagRun` to store `DagRunInfo.run_after` (i.e. the earliest time 
the DagRun _can_ happen), and calculate that against `DagRun.start_date`. That 
value is always available and would enable us to remove the block below.
   
   ```python
       @classmethod
       def exact(cls, at: DateTime) -> "DagRunInfo":
           """Represent a run on an exact time."""
           return cls(run_after=at, data_interval=DataInterval.exact(at))
   
       @classmethod
       def interval(cls, start: DateTime, end: DateTime) -> "DagRunInfo":
           """Represent a run on a continuous schedule.
   
           In such a schedule, each data interval starts right after the 
previous
           one ends, and each run is scheduled right after the interval ends. 
This
           applies to all schedules prior to AIP-39 except ``@once`` and 
``None``.
           """
           return cls(run_after=end, data_interval=DataInterval(start, end))
   ```
   
   It seems that these two methods above in `base.py` are called to assign 
value to `DagRunInfo.run_after`. If a new field is added in `DagRun` as the 
suggestion indicated above, may I ask if there is a good way to make sure that 
the new field is consistent with `DagRunInfo.run_after`? Thanks!


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to