{"action":"created","comment":{"url":"https://api.github.com/repos/RealImpactAnalytics/airflow/pulls/comments/45872034","id":45872034,"diff_hunk":"@@ -1795,27 +1771,60 @@ def _set_relatives(self, task_or_task_list, upstream=False):\n         for task in task_list:\n             if not isinstance(task, BaseOperator):\n                 raise AirflowException('Expecting a task')\n-            if upstream:\n-                self.append_only_new(task._downstream_list, self)\n-                self.append_only_new(self._upstream_list, task)\n-            else:\n-                self.append_only_new(task._upstream_list, self)\n-                self.append_only_new(self._downstream_list, task)\n-        self.detect_downstream_cycle()\n+        return task_list\n+\n+    def add_downstream_task(self, task):\n+        self._downstream_list.append(task)\n+\n+    def add_trigger(self, trigger):\n+        if trigger in self._triggers:\n+            raise AirflowException(\n+                'Dependency {trigger} -> {self} already registered'\n+                ''.format(**locals()))\n+        self._triggers.append(trigger)\n+\n+    def create_trigger(self, trigger_rule, task):\n+\n+        if trigger_rule == TriggerRule.ALL_DONE:\n+            return DoneTrigger(task)\n+\n+        elif trigger_rule in [TriggerRule.ALL_SUCCESS, TriggerRule.ONE_SUCCESS]:\n+            return Trigger(task, state=State.SUCCESS)\n+\n+        elif trigger_rule in [TriggerRule.ALL_FAILED, TriggerRule.ONE_FAILED]:\n+            return Trigger(task, state=State.FAILED)\n+\n+        else:\n+            assert False, \"Trigger rule is unknown : {}\" \\\n+                            \"\".format(trigger_rule)\n ","path":"airflow/models.py","position":341,"original_position":341,"commit_id":"b792587ed5b7a4f4964c5ef07bf37b3ba385a964","original_commit_id":"b792587ed5b7a4f4964c5ef07bf37b3ba385a964","user":{"login":"svendx4f","id":1214071,"avatar_url":"https://avatars.githubusercontent.com/u/1214071?v=3","gravatar_id":"","url":"https://api.github.com/users/svendx4f","html_url":"https://github.com/svendx4f","followers_url":"https://api.github.com/users/svendx4f/followers","following_url":"https://api.github.com/users/svendx4f/following{/other_user}","gists_url":"https://api.github.com/users/svendx4f/gists{/gist_id}","starred_url":"https://api.github.com/users/svendx4f/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svendx4f/subscriptions","organizations_url":"https://api.github.com/users/svendx4f/orgs","repos_url":"https://api.github.com/users/svendx4f/repos","events_url":"https://api.github.com/users/svendx4f/events{/privacy}","received_events_url":"https://api.github.com/users/svendx4f/received_events","type":"User","site_admin":false},"body":"Yup, en fait une partie de la logique ici a le même \"concern\" que le code que je propose de bouger ci-dessus hors du contructeur: il s'agit de convertir la logique des ancienne TriggerRule en les nouveau Trigger et TriggerType \r\n=> on pourrait rassembler tout ça avec les Trigger Rule et Type et tester le tout en isolation. ","created_at":"2015-11-25T14:28:59Z","updated_at":"2015-11-25T14:28:59Z","html_url":"https://github.com/RealImpactAnalytics/airflow/pull/5#discussion_r45872034","pull_request_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/RealImpactAnalytics/airflow/pulls/comments/45872034"},"html":{"href":"https://github.com/RealImpactAnalytics/airflow/pull/5#discussion_r45872034"},"pull_request":{"href":"https://api.github.com/repos/RealImpactAnalytics/airflow/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/RealImpactAnalytics/airflow/pulls/5","id":51704407,"html_url":"https://github.com/RealImpactAnalytics/airflow/pull/5","diff_url":"https://github.com/RealImpactAnalytics/airflow/pull/5.diff","patch_url":"https://github.com/RealImpactAnalytics/airflow/pull/5.patch","issue_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/issues/5","number":5,"state":"open","locked":false,"title":"DO NOT MERGE - PR1 Triggers with final API v5","user":{"login":"thoralf-gutierrez","id":5640848,"avatar_url":"https://avatars.githubusercontent.com/u/5640848?v=3","gravatar_id":"","url":"https://api.github.com/users/thoralf-gutierrez","html_url":"https://github.com/thoralf-gutierrez","followers_url":"https://api.github.com/users/thoralf-gutierrez/followers","following_url":"https://api.github.com/users/thoralf-gutierrez/following{/other_user}","gists_url":"https://api.github.com/users/thoralf-gutierrez/gists{/gist_id}","starred_url":"https://api.github.com/users/thoralf-gutierrez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoralf-gutierrez/subscriptions","organizations_url":"https://api.github.com/users/thoralf-gutierrez/orgs","repos_url":"https://api.github.com/users/thoralf-gutierrez/repos","events_url":"https://api.github.com/users/thoralf-gutierrez/events{/privacy}","received_events_url":"https://api.github.com/users/thoralf-gutierrez/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-24T19:21:41Z","updated_at":"2015-11-25T14:28:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a0b0f84af2d18062d9ebee8bc5c455c37f0d9119","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/pulls/5/commits","review_comments_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/pulls/5/comments","review_comment_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/issues/5/comments","statuses_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/statuses/b792587ed5b7a4f4964c5ef07bf37b3ba385a964","head":{"label":"RealImpactAnalytics:PR1_Triggers_with_final_API_v5","ref":"PR1_Triggers_with_final_API_v5","sha":"b792587ed5b7a4f4964c5ef07bf37b3ba385a964","user":{"login":"RealImpactAnalytics","id":5610189,"avatar_url":"https://avatars.githubusercontent.com/u/5610189?v=3","gravatar_id":"","url":"https://api.github.com/users/RealImpactAnalytics","html_url":"https://github.com/RealImpactAnalytics","followers_url":"https://api.github.com/users/RealImpactAnalytics/followers","following_url":"https://api.github.com/users/RealImpactAnalytics/following{/other_user}","gists_url":"https://api.github.com/users/RealImpactAnalytics/gists{/gist_id}","starred_url":"https://api.github.com/users/RealImpactAnalytics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RealImpactAnalytics/subscriptions","organizations_url":"https://api.github.com/users/RealImpactAnalytics/orgs","repos_url":"https://api.github.com/users/RealImpactAnalytics/repos","events_url":"https://api.github.com/users/RealImpactAnalytics/events{/privacy}","received_events_url":"https://api.github.com/users/RealImpactAnalytics/received_events","type":"Organization","site_admin":false},"repo":{"id":46043724,"name":"airflow","full_name":"RealImpactAnalytics/airflow","owner":{"login":"RealImpactAnalytics","id":5610189,"avatar_url":"https://avatars.githubusercontent.com/u/5610189?v=3","gravatar_id":"","url":"https://api.github.com/users/RealImpactAnalytics","html_url":"https://github.com/RealImpactAnalytics","followers_url":"https://api.github.com/users/RealImpactAnalytics/followers","following_url":"https://api.github.com/users/RealImpactAnalytics/following{/other_user}","gists_url":"https://api.github.com/users/RealImpactAnalytics/gists{/gist_id}","starred_url":"https://api.github.com/users/RealImpactAnalytics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RealImpactAnalytics/subscriptions","organizations_url":"https://api.github.com/users/RealImpactAnalytics/orgs","repos_url":"https://api.github.com/users/RealImpactAnalytics/repos","events_url":"https://api.github.com/users/RealImpactAnalytics/events{/privacy}","received_events_url":"https://api.github.com/users/RealImpactAnalytics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RealImpactAnalytics/airflow","description":"Airflow is a system to programmatically author, schedule and monitor data pipelines.","fork":true,"url":"https://api.github.com/repos/RealImpactAnalytics/airflow","forks_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/forks","keys_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/teams","hooks_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/hooks","issue_events_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/issues/events{/number}","events_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/events","assignees_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/assignees{/user}","branches_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/branches{/branch}","tags_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/tags","blobs_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/statuses/{sha}","languages_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/languages","stargazers_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/stargazers","contributors_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/contributors","subscribers_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/subscribers","subscription_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/subscription","commits_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/contents/{+path}","compare_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/merges","archive_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/downloads","issues_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/issues{/number}","pulls_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/pulls{/number}","milestones_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/milestones{/number}","notifications_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/labels{/name}","releases_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/releases{/id}","created_at":"2015-11-12T09:48:01Z","updated_at":"2015-11-19T21:24:17Z","pushed_at":"2015-11-25T14:00:28Z","git_url":"git://github.com/RealImpactAnalytics/airflow.git","ssh_url":"git@github.com:RealImpactAnalytics/airflow.git","clone_url":"https://github.com/RealImpactAnalytics/airflow.git","svn_url":"https://github.com/RealImpactAnalytics/airflow","homepage":"","size":6830,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"RealImpactAnalytics:end_to_end_dag_tester","ref":"end_to_end_dag_tester","sha":"4e9388c9c9c85ddd294d4850b42d5e4df5d4f0b3","user":{"login":"RealImpactAnalytics","id":5610189,"avatar_url":"https://avatars.githubusercontent.com/u/5610189?v=3","gravatar_id":"","url":"https://api.github.com/users/RealImpactAnalytics","html_url":"https://github.com/RealImpactAnalytics","followers_url":"https://api.github.com/users/RealImpactAnalytics/followers","following_url":"https://api.github.com/users/RealImpactAnalytics/following{/other_user}","gists_url":"https://api.github.com/users/RealImpactAnalytics/gists{/gist_id}","starred_url":"https://api.github.com/users/RealImpactAnalytics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RealImpactAnalytics/subscriptions","organizations_url":"https://api.github.com/users/RealImpactAnalytics/orgs","repos_url":"https://api.github.com/users/RealImpactAnalytics/repos","events_url":"https://api.github.com/users/RealImpactAnalytics/events{/privacy}","received_events_url":"https://api.github.com/users/RealImpactAnalytics/received_events","type":"Organization","site_admin":false},"repo":{"id":46043724,"name":"airflow","full_name":"RealImpactAnalytics/airflow","owner":{"login":"RealImpactAnalytics","id":5610189,"avatar_url":"https://avatars.githubusercontent.com/u/5610189?v=3","gravatar_id":"","url":"https://api.github.com/users/RealImpactAnalytics","html_url":"https://github.com/RealImpactAnalytics","followers_url":"https://api.github.com/users/RealImpactAnalytics/followers","following_url":"https://api.github.com/users/RealImpactAnalytics/following{/other_user}","gists_url":"https://api.github.com/users/RealImpactAnalytics/gists{/gist_id}","starred_url":"https://api.github.com/users/RealImpactAnalytics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RealImpactAnalytics/subscriptions","organizations_url":"https://api.github.com/users/RealImpactAnalytics/orgs","repos_url":"https://api.github.com/users/RealImpactAnalytics/repos","events_url":"https://api.github.com/users/RealImpactAnalytics/events{/privacy}","received_events_url":"https://api.github.com/users/RealImpactAnalytics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RealImpactAnalytics/airflow","description":"Airflow is a system to programmatically author, schedule and monitor data pipelines.","fork":true,"url":"https://api.github.com/repos/RealImpactAnalytics/airflow","forks_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/forks","keys_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/teams","hooks_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/hooks","issue_events_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/issues/events{/number}","events_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/events","assignees_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/assignees{/user}","branches_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/branches{/branch}","tags_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/tags","blobs_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/statuses/{sha}","languages_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/languages","stargazers_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/stargazers","contributors_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/contributors","subscribers_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/subscribers","subscription_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/subscription","commits_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/contents/{+path}","compare_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/merges","archive_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/downloads","issues_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/issues{/number}","pulls_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/pulls{/number}","milestones_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/milestones{/number}","notifications_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/labels{/name}","releases_url":"https://api.github.com/repos/RealImpactAnalytics/airflow/releases{/id}","created_at":"2015-11-12T09:48:01Z","updated_at":"2015-11-19T21:24:17Z","pushed_at":"2015-11-25T14:00:28Z","git_url":"git://github.com/RealImpactAnalytics/airflow.git","ssh_url":"git@github.com:RealImpactAnalytics/airflow.git","clone_url":"https://github.com/RealImpactAnalytics/airflow.git","svn_url":"https://github.com/RealImpactAnalytics/airflow","homepage":"","size":6830,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RealImpactAnalytics/airflow/pulls/5"},"html":{"href":"https://github.com/RealImpactAnalytics/airflow/pull/5"},"issue":{"href":"https://api.github.com/repos/RealImpactAnalytics/airflow/issues/5"},"comments":{"href":"https://api.github.com/repos/RealImpactAnalytics/airflow/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/RealImpactAnalytics/airflow/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/RealImpactAnalytics/airflow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RealImpactAnalytics/airflow/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/RealImpactAnalytics/airflow/statuses/b792587ed5b7a4f4964c5ef07bf37b3ba385a964"}}}}