From 1eb4a9e5dd3845b8cb274f7cffc58c6c5f666473 Mon Sep 17 00:00:00 2001 From: kalluripradeep Date: Sat, 7 Mar 2026 18:46:48 +0000 Subject: [PATCH 1/4] fix: ensure execute_command is registered with Celery app at worker startup --- airflow/providers/celery/executors/celery_executor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/airflow/providers/celery/executors/celery_executor.py b/airflow/providers/celery/executors/celery_executor.py index 93037bb31c136..9a2d6ca194ac5 100644 --- a/airflow/providers/celery/executors/celery_executor.py +++ b/airflow/providers/celery/executors/celery_executor.py @@ -56,6 +56,10 @@ from airflow.executors.base_executor import BaseExecutor from airflow.stats import Stats from airflow.utils.state import TaskInstanceState +# Must be imported at module level to register execute_command with the Celery app +# and connect the celery_import_modules signal handler at worker startup. +# See: https://github.com/apache/airflow/issues/63043 +from airflow.providers.celery.executors import celery_executor_utils as _celery_executor_utils # noqa: F401 log = logging.getLogger(__name__) From c3e5013a5aea518cf1301bcaecd2a0e8f574dabe Mon Sep 17 00:00:00 2001 From: kalluripradeep Date: Sat, 7 Mar 2026 20:03:47 +0000 Subject: [PATCH 2/4] fix import order for prek static checks --- airflow/providers/celery/executors/celery_executor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/airflow/providers/celery/executors/celery_executor.py b/airflow/providers/celery/executors/celery_executor.py index 9a2d6ca194ac5..7b59bd8a98606 100644 --- a/airflow/providers/celery/executors/celery_executor.py +++ b/airflow/providers/celery/executors/celery_executor.py @@ -54,12 +54,12 @@ from airflow.configuration import conf from airflow.exceptions import AirflowTaskTimeout from airflow.executors.base_executor import BaseExecutor -from airflow.stats import Stats -from airflow.utils.state import TaskInstanceState # Must be imported at module level to register execute_command with the Celery app # and connect the celery_import_modules signal handler at worker startup. # See: https://github.com/apache/airflow/issues/63043 from airflow.providers.celery.executors import celery_executor_utils as _celery_executor_utils # noqa: F401 +from airflow.stats import Stats +from airflow.utils.state import TaskInstanceState log = logging.getLogger(__name__) From 9fbcca4fb81359ab02657375bb71e27bd4b7fa07 Mon Sep 17 00:00:00 2001 From: kalluripradeep Date: Sat, 7 Mar 2026 20:31:40 +0000 Subject: [PATCH 3/4] move comment inline to fix prek import checks --- airflow/providers/celery/executors/celery_executor.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/airflow/providers/celery/executors/celery_executor.py b/airflow/providers/celery/executors/celery_executor.py index 7b59bd8a98606..0e207909accd9 100644 --- a/airflow/providers/celery/executors/celery_executor.py +++ b/airflow/providers/celery/executors/celery_executor.py @@ -54,10 +54,7 @@ from airflow.configuration import conf from airflow.exceptions import AirflowTaskTimeout from airflow.executors.base_executor import BaseExecutor -# Must be imported at module level to register execute_command with the Celery app -# and connect the celery_import_modules signal handler at worker startup. -# See: https://github.com/apache/airflow/issues/63043 -from airflow.providers.celery.executors import celery_executor_utils as _celery_executor_utils # noqa: F401 +from airflow.providers.celery.executors import celery_executor_utils as _celery_executor_utils # noqa: F401 # Needed to register execute_command with Celery app at worker startup, see #63043 from airflow.stats import Stats from airflow.utils.state import TaskInstanceState From 4fe0fcd5038e910f43c16d69ab1ca56febdf8295 Mon Sep 17 00:00:00 2001 From: kalluripradeep Date: Sat, 7 Mar 2026 21:00:35 +0000 Subject: [PATCH 4/4] fix: wrap import in parens as required by prek --- airflow/providers/celery/executors/celery_executor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/airflow/providers/celery/executors/celery_executor.py b/airflow/providers/celery/executors/celery_executor.py index 0e207909accd9..bddea8bd2879a 100644 --- a/airflow/providers/celery/executors/celery_executor.py +++ b/airflow/providers/celery/executors/celery_executor.py @@ -54,7 +54,9 @@ from airflow.configuration import conf from airflow.exceptions import AirflowTaskTimeout from airflow.executors.base_executor import BaseExecutor -from airflow.providers.celery.executors import celery_executor_utils as _celery_executor_utils # noqa: F401 # Needed to register execute_command with Celery app at worker startup, see #63043 +from airflow.providers.celery.executors import ( + celery_executor_utils as _celery_executor_utils, # noqa: F401 # Needed to register execute_command with Celery app at worker startup, see #63043 +) from airflow.stats import Stats from airflow.utils.state import TaskInstanceState