amoghrajesh commented on code in PR #61461:
URL: https://github.com/apache/airflow/pull/61461#discussion_r2871162165


##########
airflow-core/src/airflow/serialization/definitions/deadline.py:
##########
@@ -259,7 +310,9 @@ class TYPES:
 )
 SerializedReferenceModels.TYPES.DAGRUN_QUEUED = 
(SerializedReferenceModels.DagRunQueuedAtDeadline,)
 SerializedReferenceModels.TYPES.DAGRUN = (
-    SerializedReferenceModels.TYPES.DAGRUN_CREATED + 
SerializedReferenceModels.TYPES.DAGRUN_QUEUED
+    SerializedReferenceModels.TYPES.DAGRUN_CREATED
+    + SerializedReferenceModels.TYPES.DAGRUN_QUEUED
+    + (SerializedReferenceModels.SerializedCustomReference,)
 )

Review Comment:
   Handled in [comments from 
tp](https://github.com/apache/airflow/pull/61461/commits/4394c58781d57bdf99d13ad3e18d5a5a404f9c34)



##########
airflow-core/src/airflow/serialization/definitions/deadline.py:
##########
@@ -239,6 +250,52 @@ def serialize_reference(self) -> dict:
         def deserialize_reference(cls, reference_data: dict):
             return cls(max_runs=reference_data["max_runs"], 
min_runs=reference_data.get("min_runs"))
 
+    class SerializedCustomReference(SerializedBaseDeadlineReference):
+        """Wrapper for custom deadline references."""
+
+        def __init__(self, inner_ref):
+            self.inner_ref = inner_ref
+
+        @property
+        def reference_name(self) -> str:
+            return self.inner_ref.reference_name
+
+        def evaluate_with(self, *, session: Session, interval: timedelta, 
**kwargs: Any) -> datetime | None:
+            filtered_kwargs = {k: v for k, v in kwargs.items() if k in 
self.required_kwargs}

Review Comment:
   Good catch, handled in [pass to inner_ref through 
kwargs](https://github.com/apache/airflow/pull/61461/commits/c65ae8a147bed7f962b622f78d51cef937ebef60)



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