From 3806e8267ecefefc19e657a479bf136c24c0777b Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Wed, 27 Oct 2021 01:04:05 +0300 Subject: [PATCH] Allow non-serializable objects in callbacks argument --- python-package/lightgbm/sklearn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-package/lightgbm/sklearn.py b/python-package/lightgbm/sklearn.py index fb7a7fa91c1a..ac3957543894 100644 --- a/python-package/lightgbm/sklearn.py +++ b/python-package/lightgbm/sklearn.py @@ -730,7 +730,7 @@ def _get_meta_data(collection, name, i): if callbacks is None: callbacks = [] else: - callbacks = copy.deepcopy(callbacks) + callbacks = copy.copy(callbacks) # don't use deepcopy here to allow non-serializable objects if verbose != 'warn': _log_warning("'verbose' argument is deprecated and will be removed in a future release of LightGBM. "