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 A1FC3200B35 for ; Tue, 5 Jul 2016 21:56:48 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A08B9160A60; Tue, 5 Jul 2016 19:56:48 +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 E686D160A2C for ; Tue, 5 Jul 2016 21:56:47 +0200 (CEST) Received: (qmail 68825 invoked by uid 500); 5 Jul 2016 19:56:47 -0000 Mailing-List: contact dev-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 dev@airflow.incubator.apache.org Received: (qmail 68814 invoked by uid 99); 5 Jul 2016 19:56:47 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jul 2016 19:56:47 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id A797D1806EA for ; Tue, 5 Jul 2016 19:56:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1 X-Spam-Level: * X-Spam-Status: No, score=1 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1] autolearn=disabled Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id oJcNUgET8-3G for ; Tue, 5 Jul 2016 19:56:43 +0000 (UTC) Received: from server303.xenserve.com (ns1.303.xenserve.com [46.183.10.7]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id E97765F1F6 for ; Tue, 5 Jul 2016 19:56:42 +0000 (UTC) Received: from webmail.qrmedia.com (localhost [IPv6:::1]) by server303.xenserve.com (Postfix) with ESMTPA id 14FEA2BF31D; Tue, 5 Jul 2016 20:56:35 +0100 (BST) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Tue, 05 Jul 2016 15:56:35 -0400 From: Andrew Phillips To: dev@airflow.incubator.apache.org Cc: Laura Lorenz Subject: Re: (Recommended) way to define a failure handler that *only* triggers on FAILED, not on UPSTREAM_FAILED? In-Reply-To: References: <0ed9b8fae3da5afb32a9ec31bc9087a9@qrmedia.com> Message-ID: <062e388472a63aa9242197d34f2af50b@qrmedia.com> X-Sender: andrewp@apache.org User-Agent: Roundcube Webmail/1.1.4 archived-at: Tue, 05 Jul 2016 19:56:48 -0000 > I'm confused that a failed status on short_circuit doesn't list its > associated DagRun as failed. I was under the impression a DagRun was > given > failed status if any of its tasks failed. Thanks for the comments, Laura! Yes, we were slightly surprised by the effect of the short circuit operator as well. Looking at the documentation, though, it appears consistent enough, since no task actually fails: "The ShortCircuitOperator is derived from the PythonOperator. It evaluates a condition and short-circuits the workflow if the condition is False. Any downstream tasks are marked with a state of “skipped”. If the condition is True, downstream tasks proceed as normal." (from [1]) From the code [2]: def execute(self, context): condition = super(ShortCircuitOperator, self).execute(context) if condition: logging.info('Proceeding with downstream tasks...') return else: logging.info('Skipping downstream tasks...') ... logging.info("Done.") Perhaps it would be worth considering a "fail_on_false" flag for the operator? That might be something we'll try ourselves as a simple custom extension of this operator. Regards ap [1] https://pythonhosted.org/airflow/code.html#airflow.operators.ShortCircuitOperator [2] https://pythonhosted.org/airflow/_modules/python_operator.html#ShortCircuitOperator