From c8e120f299ab17ba9bae4971726b3794b200a273 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Sat, 29 Jul 2023 08:56:45 +0200 Subject: [PATCH] Raise original import error in CLI vending of executors Small follow-up after #29055 - for better diagnostic of potential future problems, it would be good to re-raise the original import error, otherwise if the Import error results from some other issue than Airflow version, we will get quite a bit of head scratching trying to diagnose some of the resulting aftermath. --- airflow/providers/celery/executors/celery_executor.py | 2 ++ .../providers/cncf/kubernetes/executors/kubernetes_executor.py | 1 + 2 files changed, 3 insertions(+) diff --git a/airflow/providers/celery/executors/celery_executor.py b/airflow/providers/celery/executors/celery_executor.py index 10513605bafed..571485b9f3473 100644 --- a/airflow/providers/celery/executors/celery_executor.py +++ b/airflow/providers/celery/executors/celery_executor.py @@ -68,6 +68,8 @@ f"available in the 'airflow.executors' package. You should not use " f"the provider's executors in this version of Airflow." ) + raise + from airflow.configuration import conf from airflow.exceptions import AirflowTaskTimeout from airflow.executors.base_executor import BaseExecutor diff --git a/airflow/providers/cncf/kubernetes/executors/kubernetes_executor.py b/airflow/providers/cncf/kubernetes/executors/kubernetes_executor.py index 1c4a0e91fb4da..a5aa36d9814a7 100644 --- a/airflow/providers/cncf/kubernetes/executors/kubernetes_executor.py +++ b/airflow/providers/cncf/kubernetes/executors/kubernetes_executor.py @@ -69,6 +69,7 @@ f"available in the 'airflow.executors' package. You should not use " f"the provider's executors in this version of Airflow." ) + raise from airflow.configuration import conf from airflow.executors.base_executor import BaseExecutor from airflow.providers.cncf.kubernetes.executors.kubernetes_executor_types import POD_EXECUTOR_DONE_KEY