BasPH commented on issue #5423: [AIRFLOW-3739] Remove start_date requirement on 
DAG
URL: https://github.com/apache/airflow/pull/5423#issuecomment-502859907
 
 
   Why? I know most DAGs run on a schedule, but raising an exception if not 
setting `start_date`/`schedule_interval` IMO cancels out the use case for a 
manual only triggered DAG in Airflow (where IMO it doesn't make sense to 
provide a `start_date` and `schedule_interval`).
   
   I'd say:
   
   1. if both not set: scheduler doesn't know when to run -> manual trigger 
only _(currently not possible)_
   2. if only start_date set: default schedule_interval is `timedelta(days=1)` 
in 1.10.*, in master None. If schedule_interval=None, scheduler won't schedule 
any tasks because no intervals can be computed.
   3. if only schedule_interval set: currently raises an error "Task is missing 
the start_date parameter". Not sure if it makes sense to allow this. Maybe 
something to think about and start scheduling from the day it was added(?)
   4. if both schedule_interval and start_date set -> run at given interval 
starting from the start_date
   
   I've seen cases before where people tried to do (1) and had to set a 
start_date for no obvious reason, so that's why I suggest to not make it 
required. The scheduler should not pick up any tasks unless somebody triggers 
the DAG by hand. If we were to allow cases (1) and (4) only:
   
   ```python
   if (self.start_date and not self.schedule_interval) or (not self.start_date 
and self.schedule_interval):
       raise ...
   ```
   
   Bit swamped in work - will add a test when I find time.

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

Reply via email to