yuqian90 commented on a change in pull request #7038: [AIRFLOW-4495] allow
externally triggered dags to run for future exec dates
URL: https://github.com/apache/airflow/pull/7038#discussion_r365526869
##########
File path: airflow/jobs/scheduler_job.py
##########
@@ -629,8 +629,9 @@ def _process_task_instances(self, dag,
task_instances_list, session=None):
active_dag_runs = []
for run in dag_runs:
self.log.info("Examining DAG run %s", run)
- # don't consider runs that are executed in the future
- if run.execution_date > timezone.utcnow():
+ # don't consider runs that are executed in the future unless
+ # specified by config and schedule_interval is None
+ if run.execution_date > timezone.utcnow() and not
run.dag.allow_future_exec_dates:
Review comment:
Just realized this line needs to be changed. Note that run.dag is not yet
set at this point. You need to use the `dag` variable. Probably worth
considering adding a test for `run.execution_date > timezone.utcnow()` in
test_scheduler_job.py to detect this.
```
if run.execution_date > timezone.utcnow() and not
dag.allow_future_exec_dates:
```
----------------------------------------------------------------
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