From 4e4ca84c64c7a7b53ea632fc033b5cba16ed9eb2 Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Sun, 8 Dec 2024 23:15:22 +0100 Subject: [PATCH] remove type annotation --- python-package/lightgbm/_sklearn_compat.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/python-package/lightgbm/_sklearn_compat.py b/python-package/lightgbm/_sklearn_compat.py index c1414f1daf5d..1a6da7982102 100644 --- a/python-package/lightgbm/_sklearn_compat.py +++ b/python-package/lightgbm/_sklearn_compat.py @@ -15,7 +15,6 @@ import platform import sys from dataclasses import dataclass, field -from typing import Callable, Literal import sklearn from sklearn.utils._param_validation import validate_parameter_constraints @@ -586,11 +585,11 @@ def check_estimator( estimator=None, generate_only=False, *, - legacy: bool = True, - expected_failed_checks: dict[str, str] | None = None, - on_skip: Literal["warn"] | None = "warn", - on_fail: Literal["raise", "warn"] | None = "raise", - callback: Callable | None = None, + legacy=True, + expected_failed_checks=None, + on_skip="warn", + on_fail="raise", + callback=None, ): # legacy, on_skip, on_fail, and callback are not supported and ignored from sklearn.utils.estimator_checks import check_estimator @@ -603,8 +602,8 @@ def check_estimator( def parametrize_with_checks( estimators, *, - legacy: bool = True, - expected_failed_checks: Callable | None = None, + legacy=True, + expected_failed_checks=None, ): # legacy is not supported and ignored from sklearn.utils.estimator_checks import parametrize_with_checks