airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From san...@apache.org
Subject incubator-airflow git commit: [AIRFLOW-649] Support non-sched DAGs in LatestOnlyOp
Date Thu, 22 Dec 2016 23:27:18 GMT
Repository: incubator-airflow
Updated Branches:
  refs/heads/master edf55cd21 -> 3cec728d7


[AIRFLOW-649] Support non-sched DAGs in LatestOnlyOp

Closes #1956 from r39132/master


Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/3cec728d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/3cec728d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/3cec728d

Branch: refs/heads/master
Commit: 3cec728d73246a1e2cd6190e5539d2b9d7a2eb65
Parents: edf55cd
Author: Siddharth Anand <siddharthanand@yahoo.com>
Authored: Thu Dec 22 15:20:08 2016 -0800
Committer: Siddharth Anand <siddharthanand@yahoo.com>
Committed: Thu Dec 22 15:20:08 2016 -0800

----------------------------------------------------------------------
 airflow/operators/latest_only_operator.py | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/3cec728d/airflow/operators/latest_only_operator.py
----------------------------------------------------------------------
diff --git a/airflow/operators/latest_only_operator.py b/airflow/operators/latest_only_operator.py
index 49ba2a3..8b4e614 100644
--- a/airflow/operators/latest_only_operator.py
+++ b/airflow/operators/latest_only_operator.py
@@ -32,6 +32,13 @@ class LatestOnlyOperator(BaseOperator):
     ui_color = '#e9ffdb'  # nyanza
 
     def execute(self, context):
+        # If the DAG Run is externally triggered, then return without
+        # skipping downstream tasks
+        if context['dag_run'].external_trigger:
+            logging.info("""Externally triggered DAG_Run:
+                         allowing execution to proceed.""")
+            return
+
         now = datetime.datetime.now()
         left_window = context['dag'].following_schedule(
             context['execution_date'])


Mime
View raw message