You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/01/05 18:41:34 UTC

[GitHub] [airflow] potiuk commented on a change in pull request #7038: [AIRFLOW-4495] allow externally triggered dags to run for future exec dates

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

 ##########
 File path: airflow/models/dag.py
 ##########
 @@ -778,16 +778,24 @@ def set_dependency(self, upstream_task_id, downstream_task_id):
     def get_task_instances(
             self, start_date=None, end_date=None, state=None, session=None):
         if not start_date:
+            # TODO why 30?
             start_date = (timezone.utcnow() - timedelta(30)).date()
             start_date = timezone.make_aware(
                 datetime.combine(start_date, datetime.min.time()))
-        end_date = end_date or timezone.utcnow()
-        tis = session.query(TaskInstance).filter(
-            TaskInstance.dag_id == self.dag_id,
-            TaskInstance.execution_date >= start_date,
-            TaskInstance.execution_date <= end_date,
-            TaskInstance.task_id.in_([t.task_id for t in self.tasks]),
-        )
+        if end_date:
 
 Review comment:
   I think if we want to keep the previous behaviour (do we?) then we should add back the original behaviour when end_date is not specified and `run_future_exec_dates == False`.
   
   When `run_future_exec_dates == False`, it will behave slightly differently than before - before it was trying to find all task before utcnow, but in this case it will also find future runs (if there are any). 
   
   Unless it is all handled by the filtering in runnable_exec_date_dep.py below that is.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services