1# Licensed to the Apache Software Foundation (ASF) under one
2# or more contributor license agreements. See the NOTICE file
3# distributed with this work for additional information
4# regarding copyright ownership. The ASF licenses this file
5# to you under the Apache License, Version 2.0 (the
6# "License"); you may not use this file except in compliance
7# with the License. You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing,
12# software distributed under the License is distributed on an
13# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14# KIND, either express or implied. See the License for the
15# specific language governing permissions and limitations
16# under the License.
17"""Executors."""
18
19from __future__ import annotations
20
21from airflow.utils.deprecation_tools import add_deprecated_classes
22
23__deprecated_classes = {
24 "celery_executor": {
25 "app": "airflow.providers.celery.executors.celery_executor_utils.app",
26 "CeleryExecutor": "airflow.providers.celery.executors.celery_executor.CeleryExecutor",
27 },
28 "celery_kubernetes_executor": {
29 "CeleryKubernetesExecutor": "airflow.providers.celery.executors."
30 "celery_kubernetes_executor.CeleryKubernetesExecutor",
31 },
32 "dask_executor": {
33 "DaskExecutor": "airflow.providers.daskexecutor.executors.dask_executor.DaskExecutor",
34 },
35 "kubernetes_executor": {
36 "KubernetesExecutor": "airflow.providers.cncf.kubernetes."
37 "executors.kubernetes_executor.KubernetesExecutor",
38 },
39 "kubernetes_executor_types": {
40 "ALL_NAMESPACES": "airflow.providers.cncf.kubernetes."
41 "executors.kubernetes_executor_types.ALL_NAMESPACES",
42 "POD_EXECUTOR_DONE_KEY": "airflow.providers.cncf.kubernetes."
43 "executors.kubernetes_executor_types.POD_EXECUTOR_DONE_KEY",
44 },
45 "kubernetes_executor_utils": {
46 "AirflowKubernetesScheduler": "airflow.providers.cncf.kubernetes."
47 "executors.kubernetes_executor_utils.AirflowKubernetesScheduler",
48 "KubernetesJobWatcher": "airflow.providers.cncf.kubernetes."
49 "executors.kubernetes_executor_utils.KubernetesJobWatcher",
50 "ResourceVersion": "airflow.providers.cncf.kubernetes."
51 "executors.kubernetes_executor_utils.ResourceVersion",
52 },
53 "local_kubernetes_executor": {
54 "LocalKubernetesExecutor": "airflow.providers.cncf.kubernetes.executors.LocalKubernetesExecutor",
55 },
56}
57
58add_deprecated_classes(
59 __deprecated_classes,
60 __name__,
61 {},
62 "For Celery executors, the `celery` provider should be >= 3.3.0. "
63 "For Kubernetes executors, the `cncf.kubernetes` provider should be >= 7.4.0 for that. "
64 "For Dask executors, any version of `daskexecutor` provider is needed.",
65)