uranusjr commented on code in PR #41232:
URL: https://github.com/apache/airflow/pull/41232#discussion_r1717846006


##########
airflow/jobs/triggerer_job_runner.py:
##########
@@ -751,3 +756,31 @@ def get_trigger_by_classpath(self, classpath: str) -> 
type[BaseTrigger]:
         if classpath not in self.trigger_cache:
             self.trigger_cache[classpath] = import_string(classpath)
         return self.trigger_cache[classpath]
+
+    @staticmethod
+    def add_trigger_cancel_reasons(
+        triggerer_id, cancel_trigger_ids: set[int]
+    ) -> list[tuple[int, TriggerTerminationReason]]:
+        """
+        Add trigger cancel reasons to give consumer more context.
+
+        Currently, we only distinguish between reassigned and other reasons.
+        """
+
+        def add_reason(
+            ids: set[int], reason: TriggerTerminationReason
+        ) -> list[tuple[int, TriggerTerminationReason]]:
+            return [(trigger_id, reason) for trigger_id in ids]
+

Review Comment:
   ```suggestion
   ```
   
   No longer used anywhere?



##########
airflow/jobs/triggerer_job_runner.py:
##########
@@ -751,3 +756,31 @@ def get_trigger_by_classpath(self, classpath: str) -> 
type[BaseTrigger]:
         if classpath not in self.trigger_cache:
             self.trigger_cache[classpath] = import_string(classpath)
         return self.trigger_cache[classpath]
+
+    @staticmethod
+    def add_trigger_cancel_reasons(

Review Comment:
   It seems like this is only intended to be used as an internal method. Add a 
leading underscore to the name (`_add_trigger_cancel_reasons`) to indicate this.



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