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


##########
airflow-core/src/airflow/models/dag.py:
##########
@@ -2009,12 +2012,25 @@ def next_dagrun_data_interval(self, value: 
tuple[datetime, datetime] | None) ->
     @property
     def deadline(self):
         """Get the deserialized deadline alert."""
-        return DeadlineAlert.deserialize_deadline_alert(self._deadline) if 
self._deadline else None
+        if self._deadline is None:
+            return None
+        if isinstance(self._deadline, list):
+            return [DeadlineAlert.deserialize_deadline_alert(item) for item in 
self._deadline]
+        return DeadlineAlert.deserialize_deadline_alert(self._deadline)
 
     @deadline.setter
     def deadline(self, value):
         """Set and serialize the deadline alert."""
-        self._deadline = value if isinstance(value, dict) else 
value.serialize_deadline_alert()
+        if value is None:
+            self._deadline = None
+        elif isinstance(value, list):
+            self._deadline = [
+                item if isinstance(item, dict) else 
item.serialize_deadline_alert() for item in value
+            ]

Review Comment:
   Or maybe we could use `collections.abc.Collection`?



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to