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


##########
airflow-core/src/airflow/serialization/serialized_objects.py:
##########
@@ -512,8 +513,10 @@ def serialize(
             )
         elif isinstance(var, DAG):
             return cls._encode(DagSerialization.serialize_dag(var), 
type_=DAT.DAG)
-        elif isinstance(var, DeadlineAlert):
-            return cls._encode(DeadlineAlert.serialize_deadline_alert(var), 
type_=DAT.DEADLINE_ALERT)
+        elif isinstance(var, (DeadlineAlert, SerializedDeadlineAlert)):

Review Comment:
   On normal days, `DeadlineAlert` should be the one coming in, but I followed 
this pattern just defensively similar to how assets does it: 
https://github.com/apache/airflow/pull/58993/changes#diff-2f03f28d3201c630dfbae758caf95ada61ab10328de789fc464f6e27c4afb2d0R700-R701
   
   There is a very rare case when a serialized version can come in, like for 
example reserializing. If someone loads a DAG from db and tries to modify the 
in memory dag object. Rare case, so maybe I can remove it as well if you like.



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