Skip to content

Commit e0b207e

Browse files
author
Brendan Herger
committed
Updating tests and CategoricalImputer to correctly intepret default fill_value
1 parent 1e0ea3e commit e0b207e

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

sklearn_pandas/categorical_imputer.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,6 @@ def __init__(
7373
'Strategy {0} not in {1}'.format(self.strategy, strategies)
7474
)
7575

76-
if self.strategy == 'constant' and self.fill_value is None:
77-
raise ValueError(
78-
'Please specify a value for \'fill_value\''
79-
'when using the constant strategy.'
80-
)
81-
8276
def fit(self, X, y=None):
8377
"""
8478

tests/test_categorical_imputer.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,6 @@ def test_custom_replacement(replacement_value, input_type):
156156
assert (Xt == ['a', replacement_value, 'b', 'b']).all()
157157

158158

159-
def test_missing_replacement():
160-
"""
161-
Raise error if no replacement value specified and strategy='constant'
162-
"""
163-
with pytest.raises(ValueError):
164-
CategoricalImputer(strategy="constant")
165-
166-
167159
def test_invalid_strategy():
168160
"""
169161
Raise an error if an invalid strategy is entered

0 commit comments

Comments
 (0)