You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/08/05 07:05:58 UTC

[GitHub] [airflow] ephraimbuddy commented on a change in pull request #17426: Allow using default celery commands for custom Celery executors subclassed from existing

ephraimbuddy commented on a change in pull request #17426:
URL: https://github.com/apache/airflow/pull/17426#discussion_r683184327



##########
File path: airflow/cli/cli_parser.py
##########
@@ -60,10 +62,15 @@ def _check_value(self, action, value):
         if action.dest == 'subcommand' and value == 'celery':
             executor = conf.get('core', 'EXECUTOR')
             if executor not in (CELERY_EXECUTOR, CELERY_KUBERNETES_EXECUTOR):
-                message = (
-                    f'celery subcommand works only with CeleryExecutor, your current executor: {executor}'
-                )
-                raise ArgumentError(action, message)
+                executor_cls = import_string(ExecutorLoader.executors.get(executor, executor))
+                if not issubclass(
+                    executor_cls,
+                    (celery_executor.CeleryExecutor, celery_kubernetes_executor.CeleryKubernetesExecutor),
+                ):
+                    message = (
+                        f'celery subcommand works only with CeleryExecutor, your current executor: {executor}'

Review comment:
       ```suggestion
                           f'celery subcommand works only with CeleryExecutor, CeleryKubernetesExecutor, and the subclasses, your current executor: {executor}'
   ```
   Should we add this?




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org