airflow-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Fern <f...@fixlist.co>
Subject Re: Failing Tasks Indication
Date Thu, 08 Feb 2018 19:51:55 GMT
Is the bash script wrapping this python command running with "set -e" or
"set -o errexit"?

On Tue, Feb 6, 2018 at 4:27 AM, Johan de Braak <johan.de.braak@eleaf.com>
wrote:

> Hi,
>
>
>
> I am trying to make airflow mark tasks as failed when an exception is
> raised. I have saved a python script to disk which I would like to run with
> the BashOperator like this:
>
>
>
> import sys
>
> def myfunc(a):
>
>     if a == True:
>
>         return
>
>     else:
>
>         raise Exception
>
>
>
> if __name__ == '__main__':
>
>     try:
>
>         myfunc(False)
>
>     except:
>
>         sys.exit(1)
>
>
>
> When running code like this, I would expect that I would see a red circle
> (indicating failure) in my overview since the except part is excecuted.
> However, I see dark green indicating that the task was a succes. Could
> anyone explain how to make the tasks indicate it when they failed?
>
>
>
> Thanks in advance,
>
>
>
> *Johan de Braak*
>
> Data Analyst
>
>
>
> [image: Description: Beschrijving: Description: Description:
> M:\Project_Acquisition\ACQUISITION DOCUMENTS\09. Huisstijl en
> plaatjes\Huisstijl\LOGO ELEAF High Res.jpg]
>
>
> *johan.de.braak@eleaf.com <johan.de.braak@eleaf.com> *
> eLEAF Competence Center • *www.eleaf.com <http://www.eleaf.com/>*
>
> This message is intended for the exclusive use of the person(s) mentioned
> as recipient(s) and may contain personal and/or confidential information.
> If you have received this message in error, please notify the sender and
> delete this message from your system immediately. Directly or indirectly
> copying, disclosing, distributing, printing, publicizing and/or in any way
> using this message or any part thereof by any means is strictly prohibited
> if you are not the intended recipient(s). This message and any associated
> attachments cannot be deemed as legally binding under any circumstances
> without the express written consent from eLEAF©. eLEAF© is not responsible
> for any loss and/or damages arising from any errors and/or omissions in its
> e-mail messages. Reference to the own general terms and conditions by the
> other party is explicitly rejected by eLEAF©. Please read our general terms
> and condition on http://www.eleaf.com/legal.
>
> P You save 200 ml of water, 2g of CO2 and 2g of wood per page: Please
> print only if it is really necessary.
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message