o-nikolas commented on code in PR #29055:
URL: https://github.com/apache/airflow/pull/29055#discussion_r1278072688


##########
airflow/cli/cli_parser.py:
##########
@@ -41,10 +42,23 @@
     core_commands,
 )
 from airflow.exceptions import AirflowException
+from airflow.executors.executor_loader import ExecutorLoader
 from airflow.utils.helpers import partition
 
 airflow_commands = core_commands
 
+log = logging.getLogger(__name__)
+try:
+    executor, _ = ExecutorLoader.import_default_executor_cls(validate=False)
+    airflow_commands.extend(executor.get_cli_commands())
+except Exception:
+    executor_name = ExecutorLoader.get_default_executor_name()
+    log.exception("Failed to load CLI commands from executor: %s", 
executor_name)
+    log.error("Ensure all dependencies are met and try again")

Review Comment:
   Here is a screenshot of how it will look. Some things to note:
   
   1. I start by uninstalling a dependency of Celery
   1. Notice how if the executor is something like LocalExecutor, we get no 
warnings and everything works just fine :smiley: 
   1. If we switch to CeleryExecutor, we get:
      1. A message saying we failed to load CLI commands from executor 
<executor name>
      1. The traceback and Exception message
      1. And the helpful tip (now updated with more details from your 
suggestion @potiuk)
   1. The CLI command still works despite the issue 
     
   Let me know if you think this suffices
   ![Screenshot from 2023-07-28 
13-46-38](https://github.com/apache/airflow/assets/65743084/35b6a04d-257f-4e65-bbea-f528935504d7)
   



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