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


##########
airflow-core/src/airflow/serialization/definitions/dag.py:
##########
@@ -41,6 +41,7 @@
 from airflow.models.deadline_alert import DeadlineAlert as DeadlineAlertModel
 from airflow.models.taskinstancekey import TaskInstanceKey
 from airflow.models.tasklog import LogTemplate
+from airflow.sdk.definitions.deadline import VariableInterval

Review Comment:
   This isnt right.
   
   This breaks the client server separation pattern that this same file already 
follows for reference: 
`SerializedReferenceModels.SerializedBaseDeadlineReference` gives core a 
counterpart for each SDK reference type so core code never needs to import or 
isinstance check against the SDK classes directly. 
   
   `VariableInterval` does not have that counterpart, so core ends up depending 
on task SDK internals at runtime for this one field. We should be adding a 
`SerializedVariableInterval` (or similar) alongside 
`SerializedReferenceModels`, with `resolve()` living core side, so 
`decode_deadline_alert` returns a core type instead of the raw sdk dataclass. 
   
   Flagging now because #70370 just had to reproduce the same SDK import to fix 
a separate bug, so the gap is starting to spread.



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