From f136de419ffe08dcb9e0a167baf98737b52f93e1 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 16 Feb 2023 12:07:00 -0600 Subject: [PATCH] [python-package] fix mypy errors about custom eval functions in sklearn.py (#5721) --- python-package/lightgbm/sklearn.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python-package/lightgbm/sklearn.py b/python-package/lightgbm/sklearn.py index fec232974859..295b9f57c3cd 100644 --- a/python-package/lightgbm/sklearn.py +++ b/python-package/lightgbm/sklearn.py @@ -178,7 +178,11 @@ def __init__(self, func: _LGBM_ScikitCustomEvalFunction): """ self.func = func - def __call__(self, preds: np.ndarray, dataset: Dataset) -> Tuple[str, float, bool]: + def __call__( + self, + preds: np.ndarray, + dataset: Dataset + ) -> Union[_LGBM_EvalFunctionResultType, List[_LGBM_EvalFunctionResultType]]: """Call passed function with appropriate arguments. Parameters