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

 ##########
 File path: airflow/executors/kubernetes_executor.py
 ##########
 @@ -820,8 +877,14 @@ def _flush_result_queue(self):
             except Empty:
                 break
 
-    def end(self):
+    def end(self) -> None:
         """Called when the executor shuts down"""
+        if not self.task_queue:
+            raise AirflowException(NOT_STARTED_MESSAGE)
+        if not self.result_queue:
+            raise AirflowException(NOT_STARTED_MESSAGE)
 
 Review comment:
   I fixed it in another way. I just moved the queue initialisation to ... 
__init__ :). it was set to None there and only initialised during the start() 
method. But indeed it makes sense to set the type of those queues as 
not-optional and initialise them in __init__()

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