kaxil commented on a change in pull request #6749: [AIRFLOW-6193] Do not use 
asserts in Airflow main code
URL: https://github.com/apache/airflow/pull/6749#discussion_r355152139
 
 

 ##########
 File path: airflow/executors/executor_loader.py
 ##########
 @@ -78,8 +78,9 @@ def _get_executor(executor_name: str) -> BaseExecutor:
             from airflow import plugins_manager
             plugins_manager.integrate_executor_plugins()
             executor_path = executor_name.split('.')
-            assert len(executor_path) == 2, f"Executor {executor_name} not 
supported: " \
-                                            f"please specify in format 
plugin_module.executor"
-
-            assert executor_path[0] in globals(), f"Executor {executor_name} 
not supported"
+            if not len(executor_path) == 2:
+                raise ValueError(f"Executor {executor_name} not supported: "
+                                 f"please specify in format 
plugin_module.executor")
+            if not executor_path[0] in globals():
 
 Review comment:
   ```suggestion
               if executor_path[0] not in globals():
   ```

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