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


##########
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:
   @o-nikolas  - I've made  the change and adjusted phrasing a little.
   
   @seanghaeli  - My thought on the import is that those are clearly two 
different sections and not intended to be read as one flowing example.  But, 
with that said, you aren't the first to make that comment so I guess I'm wrong; 
I'll make the change.



-- 
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