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


##########
airflow-core/src/airflow/models/deadline_alert.py:
##########
@@ -50,13 +50,22 @@ class DeadlineAlert(Base):
     name: Mapped[str | None] = mapped_column(String(250), nullable=True)
     description: Mapped[str | None] = mapped_column(Text, nullable=True)
     reference: Mapped[dict] = mapped_column(JSON, nullable=False)
-    interval: Mapped[float] = mapped_column(Float, nullable=False)
+    interval: Mapped[dict] = mapped_column(JSON, nullable=False)
     callback_def: Mapped[dict] = mapped_column(JSON, nullable=False)
 
     def __repr__(self):
-        interval_seconds = int(self.interval)
 
-        if interval_seconds >= 3600:
+        interval_seconds = None
+
+        if isinstance(self.interval, (int, float)):
+            interval_seconds = int(self.interval)

Review Comment:
   Sorry, one last thing I just noticed.  I am pretty sure I ran intot his 
before and `int(timedelta)` will raise TypeError?  If it does, then you should 
be able to use `int(self.interval.total_seconds())` here and elsewhere instead 
now that it's seconds and not minutes.



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