diff --git a/providers/src/airflow/providers/celery/executors/default_celery.py b/providers/src/airflow/providers/celery/executors/default_celery.py index 263791f89433c..616d2c0de9cc7 100644 --- a/providers/src/airflow/providers/celery/executors/default_celery.py +++ b/providers/src/airflow/providers/celery/executors/default_celery.py @@ -87,7 +87,7 @@ def _broker_supports_visibility_timeout(url): ), "worker_concurrency": conf.getint("celery", "WORKER_CONCURRENCY", fallback=16), "worker_enable_remote_control": conf.getboolean("celery", "worker_enable_remote_control", fallback=True), - **extra_celery_config, + **(extra_celery_config if isinstance(extra_celery_config, dict) else {}), } diff --git a/providers/src/airflow/providers/celery/provider.yaml b/providers/src/airflow/providers/celery/provider.yaml index a69dae610a935..5a45989804614 100644 --- a/providers/src/airflow/providers/celery/provider.yaml +++ b/providers/src/airflow/providers/celery/provider.yaml @@ -340,7 +340,7 @@ config: version_added: ~ type: string example: ~ - default: "{}" + default: "{{}}" celery_broker_transport_options: description: | This section is for specifying options which can be passed to the diff --git a/providers/tests/celery/executors/test_celery_executor.py b/providers/tests/celery/executors/test_celery_executor.py index ee69a094dc9f4..080bc9a898d69 100644 --- a/providers/tests/celery/executors/test_celery_executor.py +++ b/providers/tests/celery/executors/test_celery_executor.py @@ -407,4 +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"] == 10