airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Inwood (JIRA)" <j...@apache.org>
Subject [jira] [Created] (AIRFLOW-884) SlackAPIPostOperator works inconsistently across two DAGs / Python scripts.
Date Fri, 17 Feb 2017 15:41:41 GMT
Matt Inwood created AIRFLOW-884:
-----------------------------------

             Summary: SlackAPIPostOperator works inconsistently across two DAGs / Python scripts.
                 Key: AIRFLOW-884
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-884
             Project: Apache Airflow
          Issue Type: Bug
          Components: api
    Affects Versions: Airflow 1.7.1.3
            Reporter: Matt Inwood
         Attachments: airflow_error.PNG

Wrote a DAG file where the script executes and then sends a message to slack. The code at
the bottom is used to implement that.

I used the same code in another DAG file. The upstream task completes successfully, but the
slack_success task does not. If I force an error into my script, it does return the slack_fail
task. 

On success, both Slack operators indicate Operater Undefined, per attached screenshot

slack_success = SlackAPIPostOperator(
    task_id='slack_success',
    token=TOKEN,
    channel='#airflow',
    username='airflow',
    text="job {{ dag }} finished at {{ ts }} successfully 8)",
    dag=dag
)

slack_fail = SlackAPIPostOperator(
    task_id='slack_fail',
    token=TOKEN,
    channel='#airflow',
    username='airflow',
    text="job '{{ dag }}' finished at {{ ts }} in disgrace >:(",
    dag=dag,
    trigger_rule=TriggerRule.ONE_FAILED
)

slack_success.set_upstream(sample_task)
slack_fail.set_upstream(sample_task)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message