ramitkataria commented on code in PR #53951:
URL: https://github.com/apache/airflow/pull/53951#discussion_r2255533156


##########
task-sdk/src/airflow/sdk/definitions/deadline.py:
##########
@@ -134,11 +136,96 @@ def deserialize_deadline_alert(cls, encoded_data: dict) 
-> DeadlineAlert:
         return cls(
             reference=reference,
             interval=timedelta(seconds=data[DeadlineAlertFields.INTERVAL]),
-            callback=data[DeadlineAlertFields.CALLBACK],  # Keep as string path
-            callback_kwargs=data[DeadlineAlertFields.CALLBACK_KWARGS],
+            callback=cast("Callback", 
deserialize(data[DeadlineAlertFields.CALLBACK])),
         )
 
 
+class Callback(ABC):

Review Comment:
   I was going to do that but I realized that this would keep it less verbose 
and if there's another more generic `Callback` in the future, then maybe we 
could combine the two or just use `as` in the `import` statement. But also I'm 
not too opinionated on this and happy to rename these to `DeadlineCallback`, 
`DeadlineAsyncCallback` and `DeadlineSyncCallback`, which you prefer



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