From e96ab9a183286587336a68370ed1ae450d19ff4c Mon Sep 17 00:00:00 2001 From: Mike Stepanovic Date: Thu, 3 Apr 2025 11:17:56 -0600 Subject: [PATCH] declutter alerts --- python/dbt_test_alert.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/dbt_test_alert.py b/python/dbt_test_alert.py index 08de31c..5263e8b 100644 --- a/python/dbt_test_alert.py +++ b/python/dbt_test_alert.py @@ -122,6 +122,9 @@ def send_alert(webhook_url): if __name__ == '__main__': - webhook_url = os.environ.get("SLACK_WEBHOOK_URL") - send_alert(webhook_url) + data = log_test_result() + + # Only send an alert if there are failures + if data['fail_count'] > 0: + send_alert(webhook_url) \ No newline at end of file