sunank200 commented on code in PR #40084:
URL: https://github.com/apache/airflow/pull/40084#discussion_r1683857744


##########
airflow/triggers/base.py:
##########
@@ -137,3 +150,105 @@ def __eq__(self, other):
         if isinstance(other, TriggerEvent):
             return other.payload == self.payload
         return False
+
+    @provide_session
+    def handle_submit(self, *, task_instance: TaskInstance, session: Session = 
NEW_SESSION) -> None:
+        """
+        Handle the submit event for a given task instance.
+
+        This function sets the next method and next kwargs of the task 
instance,
+        as well as its state to scheduled. It also adds the event's payload
+        into the kwargs for the task.
+
+        :param task_instance: The task instance to handle the submit event for.
+        :param session: The session to be used for the database callback sink.
+        """
+        # Get the next kwargs of the task instance, or an empty dictionary if 
it doesn't exist
+        next_kwargs = task_instance.next_kwargs or {}
+
+        # Add the event's payload into the kwargs for the task
+        next_kwargs["event"] = self.payload
+
+        # Update the next kwargs of the task instance
+        task_instance.next_kwargs = next_kwargs
+
+        # Remove ourselves as its trigger
+        task_instance.trigger_id = None
+
+        # Set the state of the task instance to scheduled
+        task_instance.state = TaskInstanceState.SCHEDULED

Review Comment:
   removed them



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