Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
This package adds a callback function to use in failures to DAGs and Tasks in a Airflow project.
pip install airflow-notify-sns
from datetime import timedelta
# Airflow native imports to create a DAG
from airflow import DAG, utils
from airflow.operators.bash_operator import BashOperator
# Here is function import
from airflow_notify_sns import airflow_notify_sns
# Dag Definition
dag = DAG(
dag_id='test_dag',
default_args={
'owner': 'airflow',
'depends_on_past': False,
'start_date': utils.dates.days_ago(1),
'retries': 3,
'retry_delay': timedelta(minutes=5)
},
schedule_interval="@daily",
dagrun_timeout=timedelta(minutes=60),
sla_miss_callback=airflow_notify_sns,
on_failure_callback=airflow_notify_sns
)
# Add your tasks here
t = BashOperator(
dag=dag,
task_id='test_env',
bash_command='/tmp/test.sh',
env={'EXECUTION_DATE': '{{ ds }}'},
on_failure_callback=airflow_notify_sns
)
When DAG or tasks ends in error, a notification will be send to a SNS Topic using AWS default connection (aws_default
).
This module will try to find a variable named airflow_notify_sns_arn
in your Airflow environment, containing SNS Topic ARN where message will be published to.
If variable is not found, function will abort execution with no error.
FAQs
Publish Airflow notification errors to SNS Topic
We found that airflow-notify-sns demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.