jedcunningham commented on code in PR #46944:
URL: https://github.com/apache/airflow/pull/46944#discussion_r1964458448
##########
airflow/executors/executor_loader.py:
##########
@@ -344,8 +345,24 @@ def validate_database_executor_compatibility(cls,
executor: type[BaseExecutor])
if engine and engine.dialect.name == "sqlite":
raise AirflowConfigException(f"error: cannot use SQLite with the
{executor.__name__}")
+ @classmethod
+ def _warn_of_deprecated_executor(cls, executor_name: str) -> None:
+ """
+ Warn of deprecated executor.
+
+ :param executor_name: Name of the executor
+ """
+ warnings.warn(
+ f"\nThe use and support of the {executor_name} is deprecated and
will be removed in Airflow 3.0.\n"
+ "Please migrate to using Multiple Executor Configuration
instead:\n"
+
"https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/executor/index.html#using-multiple-executors-concurrently",
Review Comment:
If you want, you can chop the index.html out so it's a bit shorter:
```suggestion
"https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/executor/#using-multiple-executors-concurrently",
```
##########
docs/apache-airflow/core-concepts/executor/index.rst:
##########
@@ -208,15 +205,23 @@ When using a single executor, Airflow metrics will behave
as they were <2.9. But
Logging works the same as the single executor use case.
-Statically-coded Hybrid Executors
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Statically-coded Hybrid Executors (Deprecated)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
There are currently two "statically coded" executors, these executors are
hybrids of two different executors: the :doc:`LocalKubernetesExecutor
<apache-airflow-providers-cncf-kubernetes:local_kubernetes_executor>` and the
:doc:`CeleryKubernetesExecutor
<apache-airflow-providers-celery:celery_kubernetes_executor>`. Their
implementation is not native or intrinsic to core Airflow. These hybrid
executors instead make use of the ``queue`` field on Task Instances to indicate
and persist which sub-executor to run on. This is a misuse of the ``queue``
field and makes it impossible to use it for its intended purpose when using
these hybrid executors.
Executors such as these also require hand crafting new "concrete" classes to
create each permutation of possible combinations of executors. This is
untenable as more executors are created and leads to more maintenance overhead.
Bespoke coding effort should not be required to use any combination of
executors.
-Therefore using these types of executors is no longer recommended.
+Therefore these types of executors are deprecated and using them is no longer
recommended.
+
+Migrating from Statically-Coded Hybrid Executors to Multi-Executor
Configuration
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Here are some steps to migrate from statically-coded hybrid executors to the
new multi-executor configuration:
+1. **Update Airflow**: Ensure you are using Airflow 2.10.0 or later.
+2. **Update executor configuration**: Update the ``core.executor``
configuration to replace the use of the statically-coded hybrid executor with
the new multi-executor configuration (i.e. a list of the executors you'd like
to use). For example, replace ``LocalKubernetesExecutor`` with
``LocalExecutor,KubernetesExecutor``.
Review Comment:
```suggestion
2. **Update executor configuration**: Update the ``[core] executor``
configuration to replace the use of the statically-coded hybrid executor with
the new multi-executor configuration (i.e. a list of the executors you'd like
to use). For example, replace ``LocalKubernetesExecutor`` with
``LocalExecutor,KubernetesExecutor``.
```
nit!
--
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]