feluelle commented on a change in pull request #6596: [AIRFLOW-6004] Untangle 
Executors class to avoid cyclic imports. Depends on [AIRFLOW-6010]
URL: https://github.com/apache/airflow/pull/6596#discussion_r350247994
 
 

 ##########
 File path: airflow/executors/base_executor.py
 ##########
 @@ -163,33 +164,46 @@ def trigger_tasks(self, open_slots: int) -> None:
                                command_to_run=command_to_run,
                                executor_config=simple_ti.executor_config)
 
-    def change_state(self, key: ExecutorKeyType, state: str):
-        """Changes state of the task."""
+    def change_state(self, key: TaskInstanceKey, state: str):
+        """
+        Changes state of the task.
+
+        :param key: Unique key for the task instance
+        :param state: State to set for the task.
+        """
         self.log.debug("Changing state: %s", key)
         try:
             self.running.remove(key)
         except KeyError:
             self.log.debug('Could not find key: %s', str(key))
         self.event_buffer[key] = state
 
-    def fail(self, key: ExecutorKeyType):
-        """Set fail state for the event"""
+    def fail(self, key: TaskInstanceKey):
+        """
+        Set fail state for the event.
+
+        :param key: Unique key for the task instance
+        """
         self.change_state(key, State.FAILED)
 
-    def success(self, key: ExecutorKeyType):
-        """Set success state for the event"""
+    def success(self, key: TaskInstanceKey):
+        """
+        Set success state for the event.
+
+        :param key: Unique key for the task instance
+        """
         self.change_state(key, State.SUCCESS)
 
-    def get_event_buffer(self, dag_ids=None):
+    def get_event_buffer(self, dag_ids=None) -> Dict[TaskInstanceKey, str]:
         """
         Returns and flush the event buffer. In case dag_ids is specified
         it will only return and flush events for the given dag_ids. Otherwise
-        it returns and flushes all
+        it returns and flushes all events,
 
 Review comment:
   . instead of ,

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to