ramitkataria commented on code in PR #53201:
URL: https://github.com/apache/airflow/pull/53201#discussion_r2214576941
##########
airflow-core/src/airflow/models/trigger.py:
##########
@@ -192,6 +194,15 @@ def fetch_trigger_ids_with_asset(cls, session: Session =
NEW_SESSION) -> set[str
query = select(asset_trigger_association_table.columns.trigger_id)
return {trigger_id for trigger_id in session.scalars(query)}
+ @classmethod
+ @provide_session
+ def fetch_trigger_ids_with_deadline_callback(cls, session: Session =
NEW_SESSION) -> set[str]:
+ """Fetch all the trigger IDs associated with a Deadline Alert."""
+ from airflow.models.deadline import Deadline
+
+ query =
select(Deadline.trigger_id).where(Deadline.trigger_id.is_not(None))
+ return {trigger_id for trigger_id in session.scalars(query)}
Review Comment:
I've made it more general purpose now so anytime there's a new special case
similar to this, only a function in the trigger model class would need to be
modified
--
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]