CI Fix scipy-dev remaining failures due to scipy sparse DeprecationWarning - #34632
Conversation
| assert_array_equal(enc.transform(X).toarray(), exp) | ||
|
|
||
|
|
||
| def test_one_hot_encoder_warning(): |
There was a problem hiding this comment.
I hesitated to remove this test alltogether. My understanding is that the test was added in #10523 which split CategoricalEncoder into OneHotEncoder and OrdinalEncoder and added plenty of deprecations in doing so. This test was probably making sure that no deprecation warnings were being raised.
|
The scipy-dev build is green. |
ogrisel
left a comment
There was a problem hiding this comment.
This LGTM. Let's merge to fix the CI.
| message=r"(?s).*All sparse matrix classes", | ||
| message=r"(?s).*All sparse matrix classes.+deprecated", | ||
| category=DeprecationWarning, | ||
| ), |
There was a problem hiding this comment.
Note that instead we could update our tests to avoid testing with scipy sparse matrices on the most recent scipy versions to avoid raising the deprecation warning instead of hiding it.
But we can proceed incrementally and consider this for a follow-up PR to ease the review process.
Fix #34621.
Here are the issues that remained after #34614:
recwarndoesn't seem to take into account our warnings filters set throughSKLEARN_WARNINGS_AS_ERRORS, which AFAICT this is not really documented and slightly surprising (pytest.warnson the other hand does use our warnings filters). I usedwarnings.catch_warnings+warnings.simplefilteron top with some explicit warning class to test that no warnings of a particular class was emitted.scipy.sparse.random,scipy.sparse.eyewere replaced by thesklearn.utils.fixesequivalent.