Skip to content

Commit 1c5274b

Browse files
fix issue 1828 about a warning (skrub-data#1908)
Co-authored-by: Jerome Dockes <jerome@dockes.org>
1 parent 436d891 commit 1c5274b

3 files changed

Lines changed: 5 additions & 10 deletions

File tree

CHANGES.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ New Features
1414

1515
Changes
1616
-------
17+
- An unnecessary warning that was raised when passing a numpy array to the
18+
TableVectorizer has been removed. :pr:`1908` by
19+
:user:`Sandrine Henry <sandrineh>`.
1720

1821
Bugfixes
1922
--------

skrub/_check_input.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,6 @@ def _handle_array(self, X):
160160
"Input should be a DataFrame. Found an array with incompatible shape:"
161161
f" {X.shape}."
162162
)
163-
warnings.warn(
164-
"Only pandas and polars DataFrames are supported, but input is a Numpy"
165-
" array. Please convert Numpy arrays to DataFrames before passing them to"
166-
" skrub transformers. Converting to pandas DataFrame with columns"
167-
" ['0', '1', …]."
168-
)
169163
import pandas as pd
170164

171165
columns = list(map(str, range(X.shape[1])))

skrub/tests/test_check_input.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,13 @@ def test_input_is_an_array():
2121
check = CheckInputDataFrame()
2222

2323
# 2D array in fit
24-
with pytest.warns(UserWarning, match="Only .* DataFrames are supported"):
25-
d = check.fit_transform(a)
24+
d = check.fit_transform(a)
2625
assert sbd.is_pandas(d)
2726
assert sbd.is_dataframe(d)
2827
assert sbd.column_names(d) == ["0", "1"]
2928

3029
# 2D array in transform
31-
with pytest.warns(UserWarning, match="Only .* DataFrames are supported"):
32-
d = check.transform(a)
30+
d = check.transform(a)
3331
assert sbd.is_pandas(d)
3432
assert sbd.is_dataframe(d)
3533
assert sbd.column_names(d) == ["0", "1"]

0 commit comments

Comments
 (0)