yuqian90 commented on a change in pull request #6943: [AIRFLOW-4495] allow 
externally triggered dags to run for future exec…
URL: https://github.com/apache/airflow/pull/6943#discussion_r362490871
 
 

 ##########
 File path: airflow/jobs/scheduler_job.py
 ##########
 @@ -629,13 +629,21 @@ 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
+            # don't consider runs that are executed in the future unless
+            # specified by config
             if run.execution_date > timezone.utcnow():
-                self.log.error(
-                    "Execution date is in future: %s",
-                    run.execution_date
-                )
-                continue
+                if conf.getboolean(
 
 Review comment:
   This is regarding my previous comment about requiring `use_job_schedule` to 
be `False`. Does something like this work?
   
   ```python
               self.log.info("Examining DAG run %s", run)
               # don't consider runs that are executed in the future unless
               # schedule_interval is None
               if run.execution_date > timezone.utcnow():
                   if dag.schedule_interval or not conf.getboolean(
                           'scheduler',
                           'RUN_FUTURE_EXEC_DATES',
                           fallback=False):
                       self.log.error(
                           "Execution date is in future: %s",
                           run.execution_date
                       )
                       continue
   
   ```

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