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 8EDD4200B26 for ; Mon, 27 Jun 2016 17:51:57 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8DA4D160A62; Mon, 27 Jun 2016 15:51:57 +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 D29CF160A54 for ; Mon, 27 Jun 2016 17:51:56 +0200 (CEST) Received: (qmail 83472 invoked by uid 500); 27 Jun 2016 15:51:56 -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 83459 invoked by uid 99); 27 Jun 2016 15:51:56 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Jun 2016 15:51:56 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 8651EC00B9 for ; Mon, 27 Jun 2016 15:51:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -5.446 X-Spam-Level: X-Spam-Status: No, score=-5.446 tagged_above=-999 required=6.31 tests=[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=-1.426] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id WRLbYf9DUajI for ; Mon, 27 Jun 2016 15:51:54 +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 B2A6B5FBE8 for ; Mon, 27 Jun 2016 15:51:53 +0000 (UTC) Received: (qmail 83193 invoked by uid 99); 27 Jun 2016 15:51:52 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Jun 2016 15:51:52 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id CABF22C1F60 for ; Mon, 27 Jun 2016 15:51:52 +0000 (UTC) Date: Mon, 27 Jun 2016 15:51:52 +0000 (UTC) From: "Chris Riccomini (JIRA)" To: commits@airflow.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (AIRFLOW-267) PythonOperators return value seems to be ignored MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 27 Jun 2016 15:51:57 -0000 [ https://issues.apache.org/jira/browse/AIRFLOW-267?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Chris Riccomini closed AIRFLOW-267. ----------------------------------- Resolution: Not A Problem > PythonOperators return value seems to be ignored > ------------------------------------------------ > > Key: AIRFLOW-267 > URL: https://issues.apache.org/jira/browse/AIRFLOW-267 > Project: Apache Airflow > Issue Type: Bug > Components: operators > Affects Versions: Airflow 1.7.0 > Reporter: Eric Johnson > Priority: Minor > > This is a simple dag that I don't think should run to completion as there as a PythonOperator that returns False which should halt the dependency. Right? > morning depends on check_false which depends on check_true. > check_true's PythonOperator returns true. So that's fine. But check_false is a PythonOperator that returns False. Shouldn't that halt the execution? > {code} > from builtins import range > from airflow.operators import BashOperator, DummyOperator, TimeSensor, PythonOperator > from airflow.models import DAG > from datetime import datetime, timedelta, time > one_day_ago = datetime.combine(datetime.today() - timedelta(1), datetime.min.time()) > args = { > 'owner': 'ejohnson', > 'start_date' : one_day_ago, > 'email' : "ejohnson@example.com", > 'email_on_failure' : True > } > # This is the master container for the mydag > mydag = DAG( > dag_id='mydag', > default_args=args, > schedule_interval=None > ) > def check_func_true(ds, **kwargs): > return True > def check_func_false(ds, **kwargs): > return False > check_false = PythonOperator( > task_id='check_false', > provide_context=True, > python_callable=check_func_false, > email="ejohnson@example.com", > email_on_retry=True, > email_on_failure=True, > retries=5, > dag=mydag) > check_true = PythonOperator( > task_id='check_true', > provide_context=True, > python_callable=check_func_true, > email="ejohnson@example.com", > email_on_retry=True, > email_on_failure=True, > retries=5, > dag=mydag) > morning = BashOperator(task_id='morning',bash_command="echo morning",dag=mydag) > morning.set_upstream(check_false) > check_false.set_upstream(check_true) > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)