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


##########
airflow-core/src/airflow/models/deadline.py:
##########
@@ -98,6 +98,61 @@ def _determine_resource() -> tuple[str, str]:
             f"{self.deadline_time} or run: {self.callback}({callback_kwargs})"
         )
 
+    @classmethod
+    @provide_session
+    def remove_deadlines(cls, *, session: Session, conditions: dict[Column, 
Any]) -> int:
+        """
+        Remove deadlines from the table which match the provided conditions 
and return the number removed.
+
+        NOTE: This should only be used to remove deadlines which are 
associated with
+            successful dagruns. If the deadline was missed, move it to the 
`missed_deadlines`
+            table after executing the callback.

Review Comment:
   No, I think the move would be handled in one place where we handle the 
callbacks.
   
   And on that note, @ramitkataria did some benchmarking and it looks like we 
may not be moving after all.  He'll follow up with that but the time to search 
an index vs a separate table is negligible even at a pretty huge scale.  I may 
have just been over-engineering it out of an abundance of caution.  More to 
come on that later.



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