8000 MAINT Remove deprecated support for int in boolean constraint (#27924) · punndcoder28/scikit-learn@0496f48 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0496f48

Browse files
authored
MAINT Remove deprecated support for int in boolean constraint (scikit-learn#27924)
1 parent 1170f21 commit 0496f48

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

sklearn/utils/_param_validation.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import math
33
import operator
44
import re
5-
import warnings
65
from abc import ABC, abstractmethod
76
from collections.abc import Iterable
87
from inspect import signature
@@ -587,20 +586,9 @@ def __init__(self):
587586
self._constraints = [
588587
_InstancesOf(bool),
589588
_InstancesOf(np.bool_),
590-
_InstancesOf(Integral),
591589
]
592590

593591
def is_satisfied_by(self, val):
594-
# TODO(1.4) remove support for Integral.
595-
if isinstance(val, Integral) and not isinstance(val, bool):
596-
warnings.warn(
597-
(
598-
"Passing an int for a boolean parameter is deprecated in version"
599-
" 1.2 and won't be supported anymore in version 1.4."
600-
),
601-
FutureWarning,
602-
)
603-
604592
return any(c.is_satisfied_by(val) for c in self._constraints)
605593

606594
def __str__(self):

sklearn/utils/tests/test_param_validation.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -627,12 +627,6 @@ def f(param):
627627
f(True)
628628
f(np.bool_(False))
629629

630-
# an int is also valid but deprecated
631-
with pytest.warns(
632-
FutureWarning, match="Passing an int for a boolean parameter is deprecated"
633-
):
634-
f(1)
635-
636630

637631
def test_no_validation():
638632
"""Check that validation can be skipped for a parameter."""

0 commit comments

Comments
 (0)
0