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_r352309842
 
 

 ##########
 File path: airflow/executors/kubernetes_executor.py
 ##########
 @@ -703,10 +735,12 @@ def _create_or_update_secret(secret_name, secret_path):
             for service_account in name_path_pair_list:
                 _create_or_update_secret(service_account['name'], 
service_account['path'])
 
-    def start(self):
+    def start(self) -> None:
         """Starts the executor"""
         self.log.info('Start Kubernetes executor')
         self.worker_uuid = 
KubeWorkerIdentifier.get_or_create_current_kube_worker_uuid()
+        if not self.worker_uuid:
+            raise AirflowException("Could not get worker_uuid")
 
 Review comment:
   I actually mentioned using asserts recently in a comment to @feluelle - yes. 
I think asserts are better, but we are not using them in airflow. I'd love to 
introduce it as preferred way to mark such "assertions" and I am happy to start 
using it right now. Are you ok with it ? I am more than happy to start doing it

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