This is an automated email from the ASF dual-hosted git repository.

RNHTTR pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new decc3bdd9c8 Fix Slack notifier howto guide code example for Airflow 3 
(#66111)
decc3bdd9c8 is described below

commit decc3bdd9c854dec5715eedd52af9ea47f17df77
Author: Cole Heflin <[email protected]>
AuthorDate: Tue May 5 11:07:06 2026 -0700

    Fix Slack notifier howto guide code example for Airflow 3 (#66111)
    
    * Fix Slack notifier howto guide code example for Airflow 3
    
    Add missing required dag_id parameter, schedule=None, and catchup=False
    to the DAG constructor in the code snippet. Without dag_id the example
    raises a TypeError at parse time.
    
    * Use airflow.sdk import for DAG in Slack notifier howto guide
    
    from airflow import DAG is a legacy shim; Airflow 3 DAG authoring
    code should use from airflow.sdk import DAG.
---
 providers/slack/docs/notifications/slack_notifier_howto_guide.rst | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/providers/slack/docs/notifications/slack_notifier_howto_guide.rst 
b/providers/slack/docs/notifications/slack_notifier_howto_guide.rst
index 9f3ab65076e..edd5e9c06a1 100644
--- a/providers/slack/docs/notifications/slack_notifier_howto_guide.rst
+++ b/providers/slack/docs/notifications/slack_notifier_howto_guide.rst
@@ -30,12 +30,15 @@ Example Code:
 .. code-block:: python
 
     from datetime import datetime
-    from airflow import DAG
+    from airflow.sdk import DAG
     from airflow.providers.standard.operators.bash import BashOperator
     from airflow.providers.slack.notifications.slack import 
send_slack_notification
 
     with DAG(
+        dag_id="slack_notifier",
+        schedule=None,
         start_date=datetime(2023, 1, 1),
+        catchup=False,
         on_success_callback=[
             send_slack_notification(
                 text="The Dag {{ dag.dag_id }} succeeded",

Reply via email to