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


##########
task-sdk/src/airflow/sdk/definitions/deadline.py:
##########
@@ -29,7 +30,128 @@
 
 logger = logging.getLogger(__name__)
 
-DeadlineReferenceTypes: TypeAlias = 
tuple[type[ReferenceModels.BaseDeadlineReference], ...]
+# Field name used in serialization - must be in sync with 
SerializedReferenceModels.REFERENCE_TYPE_FIELD
+REFERENCE_TYPE_FIELD = "reference_type"
+
+
+class BaseDeadlineReference(ABC):
+    """
+    Base class for all Deadline Reference implementations.
+
+    This is a lightweight SDK class for DAG authoring. It only handles 
serialization.
+    The actual evaluation logic (_evaluate_with) is in Core's 
SerializedReferenceModels.
+
+    For custom deadline references, users should inherit from this class and 
implement
+    _evaluate_with() with deferred Core imports (imports inside the method 
body).
+    """
+
+    # way to detect builtin types. custom types inherit False while builtins 
set this to True
+    __is_builtin__: bool = False

Review Comment:
   Umm maybe what if I can add it in the encoder maybe?



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