ferruzzi commented on code in PR #73299:
URL: https://github.com/apache/airflow/pull/73299#discussion_r4567401533


##########
airflow-core/docs/howto/deadline-alerts.rst:
##########
@@ -511,6 +511,36 @@ other reference:
         # Your tasks here
         ...
 
+The ``DeadlineReference.<ClassName>`` shorthand hands you an instance 
constructed with no arguments,
+so a parameterized reference gets one carrying its defaults.  You may 
optionally import the class and
+instantiate it yourself, for example if you want to pass values:
+
+.. code-block:: python
+
+    from datetime import timedelta
+    from airflow.sdk import AsyncCallback, DAG, DeadlineAlert
+
+    from my_deadline_references import MyQueuedReference
+
+    with DAG(
+        dag_id="custom_reference_imported_directly",
+        deadline=DeadlineAlert(
+            reference=MyQueuedReference(),
+            interval=timedelta(hours=2),
+            callback=AsyncCallback(my_callback),
+        ),
+    ):
+        # Your tasks here
+        ...
+
+.. note::
+
+    The shorthand is keyed on the class name alone, so two custom references 
with the same class name
+    in different modules cannot both have it.  When that happens, neither one 
gets it and a warning
+    naming both classes is logged; import the class directly as above instead. 
 Both references
+    remain fully usable, and the scheduler still resolves either of them: only 
the shorthand is
+    withheld.

Review Comment:
   Good call, let me add that.  Thanks.  I want to tweak the phrasing some, 
too... it sounds so clinical but I couldn't think of a more casual way of 
phrasing it without losing something.  Any thoughts on that direction would be 
appreciated as well.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to