From b90a82a96bcf2c37a0a5d758cd0320d9522372b5 Mon Sep 17 00:00:00 2001 From: KubaGRe Date: Mon, 20 Oct 2025 11:25:06 +0200 Subject: [PATCH 1/3] Bump jsonschema and scikit-learn, add __sklearn_tags__ in operators.py Signed-off-by: KubaGRe --- lale/operators.py | 17 +++++++++++++++++ setup.py | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/lale/operators.py b/lale/operators.py index 4b31384f0..e61dd87d0 100644 --- a/lale/operators.py +++ b/lale/operators.py @@ -349,6 +349,23 @@ def __or__(self, other: Union[Any, "Operator"]) -> "OperatorChoice": def __ror__(self, other: Union[Any, "Operator"]) -> "OperatorChoice": return make_choice(other, self) + def __sklearn_tags__(self): + """Provide sklearn compatibility for >=1.6""" + if hasattr(self, "_impl_instance"): + impl = self._impl_instance() + if hasattr(impl, "__sklearn_tags__"): + return impl.__sklearn_tags__() + elif hasattr(impl, "_more_tags"): + return impl._more_tags() + + # fallback for safety — works with scikit-learn 1.7+ + try: + from sklearn.utils._tags import default_tags + return default_tags(self) + except ImportError: + # fallback for older sklearn versions + return {} + def name(self) -> str: """Get the name of this operator instance.""" return self._name diff --git a/setup.py b/setup.py index 90d66f219..50f08fa2a 100644 --- a/setup.py +++ b/setup.py @@ -45,9 +45,9 @@ "numpy", "black>=22.1.0", "hyperopt>=0.2,<=0.2.7", - "jsonschema<=4.25.1", + "jsonschema<=5", "jsonsubschema>=0.0.6", - "scikit-learn>=1.0.0,<1.7.0", + "scikit-learn>=1.0.0,<1.8.0", "scipy", "pandas", "packaging", From 1f5c628e14e60b1ae7e8e0285171fecf5b58a0e2 Mon Sep 17 00:00:00 2001 From: KubaGRe Date: Mon, 20 Oct 2025 12:44:14 +0200 Subject: [PATCH 2/3] Fix precommit issue Signed-off-by: KubaGRe --- lale/operators.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lale/operators.py b/lale/operators.py index e61dd87d0..cf6706f24 100644 --- a/lale/operators.py +++ b/lale/operators.py @@ -357,13 +357,11 @@ def __sklearn_tags__(self): return impl.__sklearn_tags__() elif hasattr(impl, "_more_tags"): return impl._more_tags() - - # fallback for safety — works with scikit-learn 1.7+ try: from sklearn.utils._tags import default_tags + return default_tags(self) except ImportError: - # fallback for older sklearn versions return {} def name(self) -> str: From a6b17442242ed4c30bde626eedbe9227fc1c6a2b Mon Sep 17 00:00:00 2001 From: Jakub <87713562+KubaGRe@users.noreply.github.com> Date: Thu, 23 Oct 2025 09:16:06 +0200 Subject: [PATCH 3/3] Change version Signed-off-by: Jakub <87713562+KubaGRe@users.noreply.github.com> --- lale/lib/sklearn/logistic_regression.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lale/lib/sklearn/logistic_regression.py b/lale/lib/sklearn/logistic_regression.py index e20428691..40547adc1 100644 --- a/lale/lib/sklearn/logistic_regression.py +++ b/lale/lib/sklearn/logistic_regression.py @@ -618,7 +618,7 @@ def score(self, X, y, sample_weight=None): break -if lale.operators.sklearn_version >= version.Version("1.7"): +if lale.operators.sklearn_version >= version.Version("1.8"): LogisticRegression = typing.cast( lale.operators.PlannedIndividualOp, LogisticRegression.customize_schema(