viiccwen opened a new pull request, #54555:
URL: https://github.com/apache/airflow/pull/54555

   ## Summary
   
   Fix issue where custom logging configuration with simple module paths (like 
`log_config.LOGGING_CONFIG`) caused triggerer and scheduler to fail during 
startup.
   
   ## Problem
   
   When users set `logging_config_class = log_config.LOGGING_CONFIG` in their 
`airflow.cfg`, the `load_logging_config()` function would fail because:
   
   1. `logging_class_path.rsplit(".", 1)[0]` produces `"log_config"`
   2. `import_string("log_config")` fails because it expects a dot-separated 
path like `"module.submodule.attribute"`
   3. This caused `ImportError` and prevented `REMOTE_TASK_LOG` and 
`DEFAULT_REMOTE_CONN_ID` from being loaded
   4. In some environments, this prevented triggerer and scheduler from starting
   
   ## Solution
   
   Replace `import_string()` with `importlib.import_module()` in 
`load_logging_config()` (Import `importlib` inside the function to avoid 
circular imports)
   
   ## Changes
   
   ### Code
   - in`airflow-core/src/airflow/logging_config.py`, 
with`load_logging_config()` (lines 75-79)
   
   ### Test
   - in `airflow-core/tests/unit/core/test_logging_config.py`
   - **Added**: Parametrized test for different module path structures
   - **Added**: Test for graceful fallback when remote logging vars are missing
   - **Added**: Helper method to reduce test code duplication
   
   ## Related Issues
   
   resolves #54414


-- 
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]

Reply via email to