From cfdefef817bbcbba3c97156d6d42fbd23f126e46 Mon Sep 17 00:00:00 2001 From: Ayush Ojha Date: Fri, 30 Jan 2026 05:29:29 -0800 Subject: [PATCH] fix: prevent AttributeError in joblib worker config sync (#2038) In joblib worker processes, `register_from_C` can crash with `AttributeError: No such registered in self._config` when the worker's fresh Config instance hasn't fully initialized `_registered`. Use `getattr(C, "registered", False)` to safely default to False when the attribute is missing, allowing the worker to proceed with config synchronization. --- qlib/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qlib/config.py b/qlib/config.py index 4e5d62564f7..6a43bbb89a1 100644 --- a/qlib/config.py +++ b/qlib/config.py @@ -111,7 +111,7 @@ def set_conf_from_C(self, config_c): def register_from_C(config, skip_register=True): from .utils import set_log_with_config # pylint: disable=C0415 - if C.registered and skip_register: + if getattr(C, "registered", False) and skip_register: return C.set_conf_from_C(config)