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


##########
airflow-core/src/airflow/serialization/definitions/deadline.py:
##########
@@ -239,6 +250,49 @@ 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.
+
+        This class dynamically delegates to the wrapped reference for 
required_kwargs and evaluation logic.
+        """
+
+        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:
+            """Pass through all kwargs to inner reference without filtering."""
+            deadline = self.inner_ref._evaluate_with(session=session, **kwargs)

Review Comment:
   I handled it as suggested, thanks for the thorough review



##########
airflow-core/src/airflow/serialization/definitions/deadline.py:
##########
@@ -239,6 +250,49 @@ 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.
+
+        This class dynamically delegates to the wrapped reference for 
required_kwargs and evaluation logic.
+        """
+
+        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:
+            """Pass through all kwargs to inner reference without filtering."""
+            deadline = self.inner_ref._evaluate_with(session=session, **kwargs)

Review Comment:
   Handled in 0d6ff563d1



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