JonnyWaffles commented on PR #34782:
URL: https://github.com/apache/airflow/pull/34782#issuecomment-1765011741

   It looks like the test kit 
[uses](https://github.com/apache/airflow/blob/ad15af5cab6fc7aebb10d194fd5ca28a5e185492/tests/providers/celery/executors/test_celery_executor.py#L71)
 the original singleton dictionary `celery_executor_utils.celery_configuration` 
a few times, so to reduce any headache I'm tempted to leave the original global 
and app instantiation alone, so the patch would be.
   
   ```python
   celery_configuration = None
   
   @providers_configuration_loaded
   def _get_celery_app(celery_app_name) -> Celery:
       """Init providers before importing the configuration, so the _SECRET and 
_CMD options work."""
       global celery_configuration
   
       if conf.has_option("celery", "celery_config_options"):
           celery_configuration = conf.getimport("celery", 
"celery_config_options")
       else:
           from airflow.providers.celery.executors.default_celery import 
DEFAULT_CELERY_CONFIG
   
           celery_configuration = DEFAULT_CELERY_CONFIG
   
           ...
   
       return Celery(celery_app_name, config_source=celery_configuration)
   ...
   
   app = _get_celery_app(celery_app_name)
   ```
   
   This way the global configuration is still available to those like the test 
kit that were manipulating it. Thoughts? @potiuk @uranusjr 
   


-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to