airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kaxil Naik (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (AIRFLOW-3012) Email on sla miss is send only to first adress on the list
Date Wed, 05 Sep 2018 19:28:00 GMT

    [ https://issues.apache.org/jira/browse/AIRFLOW-3012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16604822#comment-16604822
] 

Kaxil Naik edited comment on AIRFLOW-3012 at 9/5/18 7:27 PM:
-------------------------------------------------------------

[~ashb] I don't see this as a bug, it is expected behavior. It is because [~solveretur] are
passing string "email1@example.com, email2@example.com" to {email}. You can do the following
if you want to use this string as an array:

{code:python}
email = Variable.get("test_recipients")
args = {
    'owner': 'airflow'
    , 'depends_on_past': False
    , 'start_date': datetime(2018, 8, 20, 0, 0)
    , 'retries': 0
    , 'email': [email] # This will convert the string to python list
    , 'email_on_failure': True
    , 'email_on_retry': True
    , 'sla': timedelta(seconds=10)
}
{code}


In general, if you want to send emails to multiple emails, you should always use list and
not string.


was (Author: kaxilnaik):
[~ashb] I don't see this as a bug, it is expected behavior. It is because you are passing
string "email1@example.com, email2@example.com" to {email}. You can do the following if you
want to use this string as an array:

{code:python}
email = Variable.get("test_recipients")
args = {
    'owner': 'airflow'
    , 'depends_on_past': False
    , 'start_date': datetime(2018, 8, 20, 0, 0)
    , 'retries': 0
    , 'email': [email] # This will convert the string to python list
    , 'email_on_failure': True
    , 'email_on_retry': True
    , 'sla': timedelta(seconds=10)
}
{code}


In general, if you want to send emails to multiple emails, you should always use list and
not string.

> Email on sla miss is send only to first adress on the list
> ----------------------------------------------------------
>
>                 Key: AIRFLOW-3012
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-3012
>             Project: Apache Airflow
>          Issue Type: Bug
>    Affects Versions: 1.9.0
>            Reporter: Marek Kowal
>            Priority: Major
>
> Description:
> I store email recipients as a variable, test_recipient: test1@test.com, [test2@test.com|mailto:test2@test.com]
> With such dag definition:
> {code:java}
> email = Variable.get("test_recipients")
> args = {
>     'owner': 'airflow'
>     , 'depends_on_past': False
>     , 'start_date': datetime(2018, 8, 20, 0, 0)
>     , 'retries': 0
>     , 'email': email
>     , 'email_on_failure': True
>     , 'email_on_retry': True
>     , 'sla': timedelta(seconds=10)
> }{code}
> On sla miss email is send only to the first person on the list, in my example [test1@test.com|mailto:test1@test.com]
> to reproduce:
> create email list variable as string and wait for sla miss



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message