From f9a05cefafa1b8480eabce8e7827d04c92338fd8 Mon Sep 17 00:00:00 2001 From: Sachin Arora Date: Sun, 22 Dec 2024 16:42:37 +0530 Subject: [PATCH] Addressed comments: Added sample config in the docs as well as reference link for all the celery configs. --- providers/src/airflow/providers/celery/provider.yaml | 4 +++- providers/tests/celery/executors/test_celery_executor.py | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/providers/src/airflow/providers/celery/provider.yaml b/providers/src/airflow/providers/celery/provider.yaml index 54cabeded5fbb..56fca3162d902 100644 --- a/providers/src/airflow/providers/celery/provider.yaml +++ b/providers/src/airflow/providers/celery/provider.yaml @@ -332,7 +332,9 @@ config: default: "False" extra_celery_config: description: | - Extra celery configs to include in the celery worker + Extra celery configs to include in the celery worker. Any of the celery config can be added to this config and it will be applied while starting the celery worker. e.g. {"worker_max_tasks_per_child": 10} + See also: + https://docs.celeryq.dev/en/stable/userguide/configuration.html#configuration-and-defaults version_added: ~ type: string example: ~ diff --git a/providers/tests/celery/executors/test_celery_executor.py b/providers/tests/celery/executors/test_celery_executor.py index a630cd3e6b99f..ee69a094dc9f4 100644 --- a/providers/tests/celery/executors/test_celery_executor.py +++ b/providers/tests/celery/executors/test_celery_executor.py @@ -407,6 +407,4 @@ def test_celery_extra_celery_config_loaded_from_string(): # reload celery conf to apply the new config importlib.reload(default_celery) - assert default_celery.DEFAULT_CELERY_CONFIG["extra_celery_config"] == { - "worker_max_tasks_per_child": 10 - } + assert default_celery.DEFAULT_CELERY_CONFIG["extra_celery_config"] == {"worker_max_tasks_per_child": 10}