Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C35F5200AC0 for ; Tue, 10 May 2016 00:54:03 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C1E52160A0F; Mon, 9 May 2016 22:54:03 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0B9FC1609A8 for ; Tue, 10 May 2016 00:54:02 +0200 (CEST) Received: (qmail 1251 invoked by uid 500); 9 May 2016 22:54:01 -0000 Mailing-List: contact commits-help@airflow.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airflow.incubator.apache.org Delivered-To: mailing list commits@airflow.incubator.apache.org Received: (qmail 1242 invoked by uid 99); 9 May 2016 22:54:01 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 May 2016 22:54:01 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 630F11A02DC for ; Mon, 9 May 2016 22:54:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.221 X-Spam-Level: X-Spam-Status: No, score=-3.221 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id nmTxJ4VV9dk2 for ; Mon, 9 May 2016 22:53:59 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with SMTP id 8B16F5F23A for ; Mon, 9 May 2016 22:53:58 +0000 (UTC) Received: (qmail 1016 invoked by uid 99); 9 May 2016 22:53:57 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 May 2016 22:53:57 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 880D4E0B49; Mon, 9 May 2016 22:53:57 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jlowin@apache.org To: commits@airflow.incubator.apache.org Message-Id: <650a10e597f94002904a8895808a96dd@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: incubator-airflow git commit: AIRFLOW-52 Warn about overwriting tasks in a DAG Date: Mon, 9 May 2016 22:53:57 +0000 (UTC) archived-at: Mon, 09 May 2016 22:54:03 -0000 Repository: incubator-airflow Updated Branches: refs/heads/master 61f35782f -> 385add2bf AIRFLOW-52 Warn about overwriting tasks in a DAG Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/385add2b Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/385add2b Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/385add2b Branch: refs/heads/master Commit: 385add2bf3eb7cd6103cfec0e5516234eeb72443 Parents: 61f3578 Author: jlowin Authored: Mon May 9 18:53:24 2016 -0400 Committer: jlowin Committed: Mon May 9 18:53:24 2016 -0400 ---------------------------------------------------------------------- airflow/models.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/385add2b/airflow/models.py ---------------------------------------------------------------------- diff --git a/airflow/models.py b/airflow/models.py index a40d2d4..f47d1a6 100644 --- a/airflow/models.py +++ b/airflow/models.py @@ -2979,9 +2979,13 @@ class DAG(LoggingMixin): task.start_date = self.start_date if task.task_id in self.task_dict: - raise AirflowException( - "Task id '{0}' has already been added " - "to the DAG ".format(task.task_id)) + #TODO raise an error in Airflow 2.0 + warnings.warn( + 'The requested task could not be added to the DAG because a ' + 'task with task_id {} is already in the DAG. Starting in ' + 'Airflow 2.0, trying to overwrite a task will raise an ' + 'exception.'.format(task.task_id), + category=PendingDeprecationWarning) else: self.tasks.append(task) self.task_dict[task.task_id] = task